> I need to code some boosting logic when some field equal to > some value. I > was able to get it work if using dismax query parser. > However, since the > solr query will need to handle prefix or fuzzy query, > therefore, dismax > query parser is not really my choice. > > Therefore, i want to use standard query parser, but still > have dismax's > boosting query logic. For example, this query return > all the titles > regardless what the value is, however, will boost the score > of those which > genres=5237: > > http://localhost:8983/solr/titles/select?indent=on&start=0&rows=10&fl=*%2Cscore&wt=standard&explainOther=&hl.fl=&qt=standard&q={!boost%20b=genres:5237^2.2}*%3A*&debugQuery=on > > > Here is the exception i get: > HTTP ERROR: 400 > > org.apache.lucene.queryParser.ParseException: Expected ',' > at position 6 in > 'genres:5237^2.2'
BoostingQParserPlugin takes a FunctionQuery. In your case it is lucene/solr query. If you want to boost by solr/lucene query, you can add that clause as optional clause. Thats all. q=+*:* genres:5237^2.2&q.op=OR will do the trick. Just make sure that you are using OR as a default operator.