问题
supposedly I have 4
words (let's call them a,b,c
andd
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