博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Solr5.5版本使用tika索引文件夹下所有文件
阅读量:6892 次
发布时间:2019-06-27

本文共 14023 字,大约阅读时间需要 46 分钟。

hot3.png

最新项目中有个需求,需要检索上传的word文档,并给出提示,本博客使用solr+tika完成,之前solr的搭建已经详细的写过,有不清楚的参考上篇博客,在上篇的基础上需要改动如下配置文件 修改solrconfig.xml

5.5.0
${solr.data.dir:}
${solr.hdfs.home:}
${solr.hdfs.confdir:}
${solr.hdfs.blockcache.enabled:true}
${solr.hdfs.blockcache.global:true}
true
managed-schema
${solr.lock.type:native}
true
${solr.autoCommit.maxTime:15000}
false
${solr.autoSoftCommit.maxTime:-1}
1024
true
20
200
static firstSearcher warming in solrconfig.xml
false
2
tika-data-config.xml
explicit
10
text
explicit
json
true
text
explicit
velocity
browse
layout
edismax
*:*
10
*,score
on
1
text
true
ignored_
true
links
ignored_
explicit
true
text_general
default
text
solr.DirectSolrSpellChecker
internal
0.5
2
1
5
4
0.01
wordbreak
solr.WordBreakSolrSpellChecker
name
true
true
10
text
default
wordbreak
on
true
10
5
5
true
true
10
5
spellcheck
mySuggester
FuzzyLookupFactory
DocumentDictionaryFactory
cat
price
string
true
10
suggest
text
true
tvComponent
true
false
terms
100
70
0.5
[-\w ,/\n\"']{20,200}
]]>
]]>
,, ,, ,, ,, ,]]>
]]>
10
.,!?
WORD
en
US
text/plain; charset=UTF-8
${velocity.template.base.dir:}
5
*:*

修改tika-data-config.xml如下

修改managed-schema配置

配置文件中主要用到BinFiledataSource 数据源,BinFiledataSource 用来获取文件的一些基础属性,包括文件大小 名称等,它的文档实例叫做“files”,因为不是给它做索引,所以需要设置rootEntity=”false”,实例中用到的几个属性如下:

1.fileAbsolutePath: 文档的唯一索引2.fileSize: 文档的大小3.fileLastModified: 文档的最后修改时间

接下来使用TikaEntityProcessor处理器来分析文档中的内容,并做索引,用到的几个属性如下:

1.file:文件名称,与上面写的fileAbsolutePath不同2.Autor、Title:都是文档的meta属性3.text:文档的文本内容

转载于:https://my.oschina.net/scottCoder/blog/1504770

你可能感兴趣的文章
iOS 学习笔记27-CALayer
查看>>
记一次被面试的final问题
查看>>
[转]Python shutil 模块
查看>>
微信跳一跳刷分实现
查看>>
[Codeforces958E2]Guard Duty (medium)(区间DP)
查看>>
jQuery的$符号
查看>>
ARDUINO入门按键通信试验
查看>>
登陆ECP后,无法正常现实OU
查看>>
编程之美第一题:传话游戏
查看>>
P1011 车站
查看>>
实用的chrome插件
查看>>
average column data from multiple files
查看>>
多重背包
查看>>
ODOO引用Echarts数据展示
查看>>
ios之coretext
查看>>
kettle记录集(Merge Join)使用
查看>>
php pthread 多线程
查看>>
OR in Matrix
查看>>
使用sql更改表的列的数据类型和添加新列和约束
查看>>
python 开发技巧(0)-- 各个系统的python安装
查看>>