开发者

Solr questions regarding handler resolution and escaping

I have a couple of questions regarding Solr usage:

  1. Certain requests can be sent to different paths (handlers?). For example, the MoreLikeThis component can being sent to either /select or /mlt.

I have found these two links in the Solr wiki:

http://localhost:8983/solr/mlt?q=id:UTF8TEST&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1&mlt.match.include=false

http://localhost:8983/solr/select?q=apache&mlt=true&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1&fl=id,score

What is the reasoning behind this setup? If I decide to send my MoreLikeThis requests to /mlt does this mean I can not utilize any /select specific calls - if there is even such a thing - such as facets - ? If not, can a /select path can be configured to handle all requests from Spellcheck to Clustering?

  1. How do 开发者_运维百科you escape double character special strings (&&, ||) in Lucene?

http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Escaping+Special+Characters

Do I escape the first character only (\&&) or do I escape both? And when do I need to escape them? A couple of tests that I performed on the example server provided in the Solr package were inconclusive:

http://localhost:8983/solr/select/?q=manu:%22apple%20%26%26%22%20AND%20manu:%22computer%22

Still returns results,


1) The rationale behind MoreLikeThisHandler is explained in the Solr wiki:

When you specifically want information about similar documents, you can use the MoreLikeThisHandler.

If you want to filter the similar results given by MoreLikeThis you have to use the MoreLikeThisHandler. It will consider the similar document result set as the main one so will apply the specified filters (fq) on it. If you use the MoreLikeThisComponent and apply query filters it will be applyed to the result set returned by the main query (QueryComponent) and not to the one returned by the MoreLikeThisComponent.

2) You need to escape every single character.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜