首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Apache Solr中提取PDF

从Apache Solr中提取PDF
EN

Stack Overflow用户
提问于 2017-07-09 21:14:21
回答 1查看 619关注 0票数 0

我是Solr索引的新手。我使用了Solr5.5,并在其中索引了一个pdf文件,只需使用

代码语言:javascript
复制
#bin/post -c gettingstarted /home/ubuntu/pdf.pdf

我删除了源pdf文件。有没有我可以从Apache Solr中提取pdf文件的方法。我可以从URL中看到它的索引

代码语言:javascript
复制
http://localhost:8983/solr/gettingstarted/select?q=*.pdf

提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-10 15:28:04

如果它在缺省情况下被正确索引,pdf内容将被索引到字段名content中,如果它在模式中正确声明的话。因此,使用content字段搜索一些关键字(或*)。

例如:q=content:keyword (关键字->,它存在于pdf中)

代码语言:javascript
复制
http://localhost:8983/solr/gettingstarted/select?q=content:*

如果未定义contetnt字段。然后在模式文件中添加字段定义。

例如:字段名声明

代码语言:javascript
复制
<field name="content" type="text_general" indexed="true" stored="true" multiValued="true"/>

字段类型定义

代码语言:javascript
复制
<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>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44996805

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档