当我索引文件(docx,pdf,html)时,文件在我的索引中,但我无法搜索内容。 所以,搜索查询
http://localhost:8983/solr/gm_core/select?q=*:*&wt=json&indent=true
返回所有索引文件,但查询
http://localhost:8983/solr/gm_core/select?q=text:*&wt=json&indent=true
返回0个匹配。
索引代码:
java -Dauto -Dc=gm_core -Drecursive -jar post.jar "{Path-to-a-file}"
schema.xml 的相关部分:
<field name="text_general" type="text_general" indexed="true" stored="false" multiValued="true" />
<field name="text_de" type="text_de" indexed="true" stored="false" multiValued="true" />
<field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
<copyfield source="*" dest="text" />
<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" />
<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>
<fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" />
<filter class="solr.GermanNormalizationFilterFactory"/>
<filter class="solr.GermanLightStemFilterFactory"/>
</analyzer>
</fieldType>
答案 0 :(得分:1)
问题在于复制字段声明。您使用了错误(使用camelCase)标记,因此无法复制数据。
<copyField source="*" dest="text"/>