开发者

When using SolrJ can I point it at a request handler?

开发者 https://www.devze.com 2022-12-31 10:47 出处:网络
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.

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').

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号