Skip to content

2.3版本 配置solr检索

朋也 edited this page Apr 14, 2017 · 1 revision

环境版本

  • jdk1.8
  • tomcat8
  • solr6.0.1

搭建solr环境教程: http://blog.csdn.net/qq_25689397/article/details/51592254 安装ik中文分词器教程: http://iamyida.iteye.com/blog/2220474 安装拼音分词教程: http://iamyida.iteye.com/blog/2222508

上面两步要是出现问题,请 百度 / Google

朋也社区里的配置介绍

// config.properties

# solr开关,true:开启,需要配置下面solr的相关参数,false:关闭
solr.status=true

# solr
solr.url=http://localhost:8080/solr/pybbs
solr.pageSize=20

如果设置的是开启状态,打开网站顶部会出现搜索框 image

在保证上面solr环境搭建并配置好的情况下,直接输入回车就可以了 image

另外,权限里增加了一项,索引所有话题(慎用) image

权限配置部分在提交代码的时候有说明,请查看github提交日志

如果点击了,系统会查询所有的未删除的话题,以及话题的追加内容,并循环索引,如果话题比较多的话,会卡一会,所以慎用

注意: solr环境搭建好了,要在 solrhome/conf/managed-schema 文件里增加一个field

<field name="in_time" type="date" indexed="true" stored="true"/>