Solr版本: 7.3.0
我想索引文件并将提取的文本注册到多字段(分词字段和二元语法字段)中,以提高搜索的灵活性。
我在configset下方编写了代码,但它不起作用,solr仅索引到content_text或content_text_bi(仅上定义的fmap.content字段)
solrconfig.xml
...
<requestHandler name="/update/extract"
startup="lazy"
class="solr.extraction.ExtractingRequestHandler" >
<lst name="defaults">
<str name="lowernames">true</str>
<str name="uprefix">ignored_</str>
<str name="fmap.meta">ignored_</str>
<str name="fmap.content">content_text</str>
<str name="fmap.content">content_text_bi</str>
<str name="captureAttr">true</str>
</lst>
</requestHandler>
...
schema.xml
...
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<!-- docValues are enabled by default for long type so we don't need to index the version field -->
<field name="_version_" type="plong" indexed="false" stored="false"/>
<field name="_root_" type="string" indexed="true" stored="false" docValues="false" />
<field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/>
<field name="content_text" type="text_ja" indexed="true" stored="true" storeOffsetsWithPositions="false"/>
<field name="content_text_bi" type="text_ja_bi" indexed="true" stored="true" storeOffsetsWithPositions="false"/>
<field name="filepath" type="string" indexed="true" stored="true" />
<field name="filename" type="string" indexed="true" stored="true" />
<field name="storage_id" type="pint" indexed="true" stored="true" />
...
我如何使其能够工作?
答案 0 :(得分:1)
我解决了在schema.xml中使用copyField的问题。
1.将此行添加到schema.xml
<copyField source="content_text" dest="content_text_bi" />
2。并在solrconfig.xml中删除此行
<str name="fmap.content">content_text_bi</str>