I have created a request handler in Solr that uses dismax and limits my query to certain fields and adds boosts for relevancy on the "title" field.
This all works fine when I go directly to Solr using an http request in a brow开发者_Go百科ser. However my question is whether I can use the request handler if I am accessing Solr using SolrJ?
It would be better if I could control boosts and filters and so on in the request handler rather than having to make code changes but I can't see how to specify a request handler in the API.
Any ideas?
In the class SolrQuery, there is a method setRequestHandler that allows you to do that. You pass the name of the request handler as defined in solrconfig.xml (probably 'dismax').
精彩评论