Filter on x% of matching words in field


(bgossey) #1

Hello,

I want to implement the following filter for a certain field in my
document.

If less than 65% of the words match, I want this document be filtered
out. The order of words doesn't matter. For example:

field contains: "word1 word2 word3", query is "word1 word2" --> a
match, 66% (so not filtered out)
field contains: "word1 word2 word3", query is "word2 word1" --> a
match, 66% (so not filtered out)
field contains: "word1 word2 word3", query is "word1" --> not a match,
only 33% (so filtered out)
field contains: "word1 word2", query is "word1" --> not a match, only
50% (so filtered out)
field contains: "word1 word2", query is "word1 word2" --> a match,
100% (so not filtered out)

Does anybody has any suggestions on what analyzer I should use (id I
need a special one) and/or what query I can use?

thanks,
Bert Gossey


(system) #2