Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Search SOLR搜索相关性与AND语句的顺序不同_Search_Solr_Solrnet - Fatal编程技术网

Search SOLR搜索相关性与AND语句的顺序不同

Search SOLR搜索相关性与AND语句的顺序不同,search,solr,solrnet,Search,Solr,Solrnet,我使用Solr版本3.6.2 我为一个名为“type”的字段编制了索引,类似于type1type2type3 当我在查询中进行无条件搜索时,我会得到一个具有一定相关性的结果。 在这种情况下,所有的搜索结果恰好是类型1类型2类型3 例如: Result 1 Result 2 Result 3 但当我向同一查询添加一个条件并明确说明它应该是type1、type2或type3时,例如:(查询)和(type:type1或type:type2或type:type3) 例如: Result 1 Resul

我使用Solr版本3.6.2

我为一个名为“type”的字段编制了索引,类似于type1type2type3

当我在查询中进行无条件搜索时,我会得到一个具有一定相关性的结果。 在这种情况下,所有的搜索结果恰好是类型1类型2类型3

例如:

Result 1
Result 2
Result 3
但当我向同一查询添加一个条件并明确说明它应该是type1、type2或type3时,例如:
(查询)和(type:type1或type:type2或type:type3)

例如:

Result 1
Result 3
Result 2
我得到了一个不同的相关性作为结果,我得到了不同的结果计数

因此,如果我添加一个已经为真的条件,我会得到不同的相关性


为什么会有这种行为?

那么它应该看起来像这样:

text:(+query) and +type:(1 2 3)^0

^0表示应满足第二个条件,但不具有相关性

在查询中尝试以下运算符

以加号(+)开头=搜索结果中必须包含

以幂号(^)开始=搜索结果中的相关性(0表示否 搜索结果的影响)

与SQL查询相比

从表1中选择*,其中text='xxx'并键入(1,2,3)