我正在尝试向 Solr 索引添加多值内容。原始字符串包含由“,”分隔的值。
<fieldtype name="commas_type" class="solr.TextField" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.PatternTokenizerFactory" pattern=",\s*"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.PatternTokenizerFactory" pattern=",\s*"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldtype>
<field name="keywords" type="commas_type" stored="true" indexed="true" multiValued="true" />
但不是得到:
<doc>
<arr name="keywords">
<str>Agile</str>
<str>Kanban</str>
<str>Clojure</str>
<str>Datomic</str>
</arr>
</doc>
我越来越:
<doc>
<arr name="keywords">
<str>Agile, Kanban</str>
<str>Clojure, Datomic</str>
</arr>
</doc>