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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.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 使用ApacheSolr搜索*_Search_Solr - Fatal编程技术网

Search 使用ApacheSolr搜索*

Search 使用ApacheSolr搜索*,search,solr,Search,Solr,当我这样搜索时:q=*6205*我得到的结果比搜索q=6205多得多,这很好 但我的问题是: 当我搜索q=6205-2RS或q=6205-2RS时,我得到了一些结果,但当我将*放入搜索字符串时,我没有收到任何结果(q=*6205-2RS*或q=*6205-2RS*)为什么 我想搜索*6205-2RS*,但我想让solr也在项目名称中间搜索此字符串。通配符查询不进行任何分析。 因此,当您使用通配符搜索6205-2RS时,它将按原样搜索,而不进行任何分析,如小写过滤器、单词分隔符 该字段的模式定义是

当我这样搜索时:q=*6205*我得到的结果比搜索q=6205多得多,这很好 但我的问题是: 当我搜索q=6205-2RS或q=6205-2RS时,我得到了一些结果,但当我将*放入搜索字符串时,我没有收到任何结果(q=*6205-2RS*或q=*6205-2RS*)为什么


我想搜索*6205-2RS*,但我想让solr也在项目名称中间搜索此字符串。

通配符查询不进行任何分析。
因此,当您使用通配符搜索
6205-2RS
时,它将按原样搜索,而不进行任何分析,如小写过滤器、单词分隔符

该字段的模式定义是什么。它是文本字段还是字符串字段类型

一般文本的定义如下:

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <!-- in this example, we will only use synonyms at query time
    <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
    -->
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

6205-2RS索引时分析中的标记器和小写过滤器将生成标记6205,2RS
由于在搜索过程中未进行分析,因此其对6205-2RS的搜索保持不变,不会找到任何结果


将字段类型更改为字符串,并且应与结果匹配。

通配符查询不进行任何分析。
因此,当您使用通配符搜索
6205-2RS
时,它将按原样搜索,而不进行任何分析,如小写过滤器、单词分隔符

该字段的模式定义是什么。它是文本字段还是字符串字段类型

一般文本的定义如下:

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <!-- in this example, we will only use synonyms at query time
    <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
    -->
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

6205-2RS索引时分析中的标记器和小写过滤器将生成标记6205,2RS
由于在搜索过程中未进行分析,因此其对6205-2RS的搜索保持不变,不会找到任何结果


将字段类型更改为字符串,且应与结果匹配。

字段类型为“text\u general”。谢谢您的回答,更改类型后是否需要重新索引整个索引?或者重新启动apache solr?是的,更改字段类型需要重新编制索引。字段类型为“text\u general”。谢谢您的回答,更改类型后是否需要重新编制整个索引的索引?或者只是重新启动apache solr?是的,更改字段类型需要重新索引。