Hi Sowmya, "bq" is a great way of boosting, but you have to be using the Dismax Query Parser or the Extended Dismax (edismax) query parser, it doesn't work with the Lucene Query Parser. If you can use any of those, then that's the solution. If you need to use the Lucene Query Parser, for a user query like:
scientific temper you could create a query like: (scientific temper) OR (scientific temper AND (field1:[10 TO 2030]))^X being "X" the boost you want for those documents. with your query: scientific temper field1:[10 TO 2030] you are either adding the condition of the range value for the field (if your default operator is AND) or adding another way of matching the query (if your default operator ir OR, you can have documents in your result set that only matched the range query, and this is not what the user wanted). Hope this helps, Tomás On Wed, Jul 20, 2011 at 5:15 AM, Sowmya V.B. <vbsow...@gmail.com> wrote: > Can anyone throw some light on this issue? > > My problem is to: give a query time boost to certain documents, which have > a > field, say field1, in the range that the user chooses during query time. I > think the below link indicates a range query: > > > http://localhost:8085/solr/select?indent=on&version=2.2&q=scientific+temper+field1:[10%20TO%2030]&start=0&rows=10 > > But, apart from that, how can I indicate a boost for the condition > field1:[10%20TO%2030]? > > I tried using a &bq=field1:[20 TO 25] and also &bq=field1:[20 TO 25]^10 > -But I am not able to figure out what these two mean, from the results. > Because, i get top1 result as a document where field1 is 40..in this > case..after using &bq clause. I increased the boost to 10,20,50 100..but > the > results dont change at all. > > S. > > On Tue, Jul 19, 2011 at 4:28 PM, Sowmya V.B. <vbsow...@gmail.com> wrote: > > > Hi > > > > Is query time boosting possible in Solr? > > > > Here is what I want to do: I want to boost the ranking of certain > > documents, which have their relevant field values, in a particular range > > (selected by user at query time)... > > > > when I do something like: > > > > > http://localhost:8085/solr/select?indent=on&version=2.2&q=scientific+temper&fq=field1:[10%20TO%2030]&start=0&rows=10 > > -I guess, it is just a filter over the normal results and not exactly a > > query. > > > > I tried giving this: > > > > > http://localhost:8085/solr/select?indent=on&version=2.2&q=scientific+temper+field1:[10%20TO%2030]&start=0&rows=10 > > -This still worked and gave me different results. But, I did not quite > > understand what this second query meant. Does it mean: "Rank those > documents > > with field1 value in 10-30 better than those without" ? > > > > S > > -- > > Sowmya V.B. > > ---------------------------------------------------- > > Losing optimism is blasphemy! > > http://vbsowmya.wordpress.com > > ---------------------------------------------------- > > > > > > -- > Sowmya V.B. > ---------------------------------------------------- > Losing optimism is blasphemy! > http://vbsowmya.wordpress.com > ---------------------------------------------------- >