solr query: x out of n words matched

狂风中的少年 提交于 2019-12-24 11:18:03

问题


supposedly I have 4 words (let's call them a,b,candd for sake of example) and I want to search in solr to match 3 of these. I could write a query with all the permutations as follows:

(a AND b AND c)OR(a AND b AND d)OR(b AND c and d)

This will work and matches documents with 3 of these 4 words.

but things get messy when I have 10 words and need to match 3 of them. The number of permutations required grows exponentially.

obviously thanks to the complexity of the query solr goes busted(it gets too slow to respond)

I've searched all over internet to find out if there is a special command I could use for something like this. I couldn't find anything. I'm just wondering if there is any tricks that could be done to accomplish something like this.


回答1:


Have a look at the mm parameter of the eDisMax parser.



来源:https://stackoverflow.com/questions/28568598/solr-query-x-out-of-n-words-matched

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!