多字段短语的Solr拼写检查器组件(建议器)(使用不同的标记器)

多字段短语的Solr拼写检查器组件(建议器)(使用不同的标记器),solr,tokenize,autosuggest,phrase,Solr,Tokenize,Autosuggest,Phrase,我正在尝试使用solr实现自动建议功能,使用多个需要支持不同令牌化器的字段。我想完成的场景如下: 有两个字段author(关键字标记器)和subject(标准标记器)被复制到autosuggest(用作拼写检查.field) 样本值: 主题-“Dell boost宽屏UltraSharp 3007WFP”; 作者-“德尔·斯蒂勒” 搜索查询:solr/select?q=de; 预期结果:戴尔、戴尔斯蒂勒 结果根据分配给autosuggest的fieldtype而有所不同。但是,我需要的是将标

我正在尝试使用solr实现自动建议功能,使用多个需要支持不同令牌化器的字段。我想完成的场景如下:

有两个字段author(关键字标记器)和subject(标准标记器)被复制到autosuggest(用作拼写检查.field)


样本值: 主题-“Dell boost宽屏UltraSharp 3007WFP”; 作者-“德尔·斯蒂勒”

搜索查询:solr/select?q=de; 预期结果:戴尔、戴尔斯蒂勒

结果根据分配给autosuggest的fieldtype而有所不同。但是,我需要的是将标记从每个字段复制到“autosuggest”,而不是复制值,然后标记器在整理的字段值上创建新标记


我使用的是SOLR 4.5.1,这里发生的是,stored=true将原始值也存储在目标字段中

对于您的简单用例,使用TermsComponent可能就足够了,看看如何做,它上面写着“在自动完成中使用”。 这将起作用,因为术语是由该组件返回的,而不是存储的值

<field name="author" type="phrase" indexed="true" stored="true" multiValued="false"/>
<field name="subject" type="text_general" indexed="true" stored="true"/> 
<field name="autosuggest" type="text_general" indexed="true" stored="true"     multiValued="true"/>
<copyField source="*" dest="autosuggest"/>
<fieldType name="phrase" class="solr.TextField" positionIncrementGap="100">
  <analyzer>
     <tokenizer class="solr.KeywordTokenizerFactory" />
     <filter class="solr.LowerCaseFilterFactory" />
     <filter class="solr.RemoveDuplicatesTokenFilterFactory" />         
   </analyzer>
</fieldType>