Re: Solr query particular value of a field last

2019-04-14 Thread Anuj Bhargava
Thanks Saurabh And Prince, Works perfectly. On Sun, 14 Apr 2019 at 17:21, Prince Manohar wrote: > Basically, you need to boost some documents low. > > For this, you can either use solr’s Boost Query ( bq ) or Boost Function > (bf) > parameter. > > For example in your case:- > > If you want the

Re: Solr query particular value of a field last

2019-04-14 Thread Prince Manohar
Basically, you need to boost some documents low. For this, you can either use solr’s Boost Query ( bq ) or Boost Function (bf) parameter. For example in your case:- If you want the documents with countries A and B to show last in the result, you can use:- bq=( country:A OR country:B )^-1 Note

Re: Solr query particular value of a field last

2019-04-14 Thread Saurabh Sharma
fq=country :c1 OR c2 OR c3=if(termfreq (country,c2),0,1) desc Correcting query. On Sun 14 Apr, 2019, 3:36 PM Saurabh Sharma, wrote: > I would suggest to sort on the basis of condition. First find all the > records and then sort on the basis of condition where you will be putting > spcific

Re: Solr query particular value of a field last

2019-04-14 Thread Saurabh Sharma
I would suggest to sort on the basis of condition. First find all the records and then sort on the basis of condition where you will be putting spcific countries below other. fq=country :c1 OR c2 OR c3=if(termfreq (country,c2),1,0) desc Here we are putting c2 below c1 and c3. You can also try

Solr query particular value of a field last

2019-04-14 Thread Anuj Bhargava
I have a field *country*. I need to do a search in which I need to show the search result of a country or some countries, last in the search result for eg. country code *BD*. What query should I use to get the above result. fq=country:???=*%3A*