2015-08-26 88 views
0

索引我的文件(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

你能提供查询网址吗? – YoungHobbit

+0

显示您的索引代码。 –

+0

添加索引代码 – Alex

回答

1

问题出在复制字段声明。您使用了错误的(使用camelCase)标签,因此它无法复制数据。

<copyField source="*" dest="text"/> 
+0

...我现在感觉不好。非常感谢^^ – Alex

0

好像你是不是保存的内容你领域。 尝试设置“stored = true”

+0

设置''不起作用 – Alex

+0

你能告诉我你怎么试来查询它们。 – kelkitian

+0

我向问题添加了查询。 – Alex