solr查询:匹配n个单词中的x个 [英] solr query: x out of n words matched

查看:141
本文介绍了solr查询:匹配n个单词中的x个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据说我有4个单词(为方便起见,我们称它们为a,b,cd),我想在solr中进行搜索以匹配其中的3. 我可以编写具有所有排列的查询,如下所示:

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)

这将起作用,并将文档与这4个单词中的3个匹配.

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

但是当我有10个单词并且需要匹配其中3个单词时,事情就会变得混乱. 所需的排列数量呈指数增长.

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

显然,由于查询的复杂性,solr崩溃了(响应太慢了)

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

我已经在Internet上进行了搜索,以查找是否有特殊命令可用于此类操作.我什么都找不到.我只是想知道是否有任何技巧可以完成这样的事情.

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.

推荐答案

看看 mm 参数.

这篇关于solr查询:匹配n个单词中的x个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆