我是Solr索引的新手。我使用了Solr5.5,并在其中索引了一个pdf文件,只需使用
#bin/post -c gettingstarted /home/ubuntu/pdf.pdf我删除了源pdf文件。有没有我可以从Apache Solr中提取pdf文件的方法。我可以从URL中看到它的索引
http://localhost:8983/solr/gettingstarted/select?q=*.pdf提前谢谢。
发布于 2017-07-10 15:28:04
如果它在缺省情况下被正确索引,pdf内容将被索引到字段名content中,如果它在模式中正确声明的话。因此,使用content字段搜索一些关键字(或*)。
例如:q=content:keyword (关键字->,它存在于pdf中)
http://localhost:8983/solr/gettingstarted/select?q=content:*如果未定义contetnt字段。然后在模式文件中添加字段定义。
例如:字段名声明
<field name="content" type="text_general" indexed="true" stored="true" multiValued="true"/>字段类型定义
<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.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>https://stackoverflow.com/questions/44996805
复制相似问题