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 如何设置Solr来标记空白和标点符号?_Search_Solr_Full Text Indexing - Fatal编程技术网

Search 如何设置Solr来标记空白和标点符号?

Search 如何设置Solr来标记空白和标点符号?,search,solr,full-text-indexing,Search,Solr,Full Text Indexing,我一直在尝试让我的Solr模式(使用Solr1.3.0)创建用空格和标点符号表示的术语。以下是一些我希望看到的例子: terms given -> terms tokenized foo-bar -> foo,bar one2three4 -> one2three4 multiple words/and some-punctuation -> multiple,words,and,some,punctuation 我认为这种组合会起作用: <fieldType

我一直在尝试让我的Solr模式(使用Solr1.3.0)创建用空格和标点符号表示的术语。以下是一些我希望看到的例子:

terms given -> terms tokenized

foo-bar -> foo,bar
one2three4 -> one2three4
multiple words/and some-punctuation -> multiple,words,and,some,punctuation
我认为这种组合会起作用:

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"/>
  </analyzer
<fieldType>
我尝试了各种
WordDelimiterFilterFactory
设置组合,但没有一种被证明是有用的。是否有一个过滤器或标记器可以处理我需要的内容?

如何

<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" splitOnNumerics="0" />


这应该可以防止一个2three4被拆分

我就是这么想的,但是无论设置如何,
generateWordParts都会在数字上拆分。您是否正确配置了查询时间?在您的OP中,我只看到定义了索引时间分析器。Solr1.4对我来说是有效的,所以我想这可能是1.3中的一个bug,或者是您的配置问题。查询时间也是如此。我开始认为这也是1.3.0中的一个bug。这当然是可能的。我自己不得不提交一些补丁来修复1.3中的bug:-/结果它不是bug。直到Solr 1.4版本,才添加了
splitOnNumerics
选项。如果SolrWiki不是只读的,我会在1.4版中记录这些选项。
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" splitOnNumerics="0" />