我正在从 MySql 导入数据。
以下是 schema.xml 中的相关字段:
<field name="solr_body" type="text_general" indexed="true" stored="true"
multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
这是 solrconfig.xml 中的配置:
<searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
<requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">text</str>
<bool name="tv">true</bool>
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
当我按照本教程提交 url http://localhost:8983/solr/select/?qt=tvrh&q=solr_body:[ +TO+ ]&fl=id 时,我得到了通常的结果,没有条款。我已删除旧索引并在架构更改后再次编制索引。我错过了什么。请帮忙。
编辑: schema.xml 中的字段类型:
<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" />
<!-- 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" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>