当前位置:首页 > 后端开发 > solr服务搭建

solr服务搭建

6个月前 (05-25)49

一。安装solr服务
1. 安装jdk,安装tomcat.
2. 解压solr压缩包
3. 将solr下的dist/solr.war部署到tomcat下。
4. 启动tomcat解压war包
5. 将example/lib/ext目录下的所有的jar包拷贝到solr工程web-info/lib下
6. 创建solrhome目录,将example/solr文件夹复制一份作为solrhome.
7. 修改web.xml。修改solrhome的位置。
solr服务搭建 _ Java侠
8. 启动tomcat.
9. 在浏览器输入http://localhost:8080/solr就可以进行访问了。
solr服务搭建 _ Java侠
二。 为solr配置中文分析器,自定义业务域。

  1. 将IKAnalyzer依赖的jar包添加到solr项目中,把分析器使用的扩展字典添加到classpath中。
  2. 对solrhome/collection1/conf/schema.xml进行修改。添加自定义的filedtype.指定中文分析器。
<fieldType name="text_ik" class="solr.TextField">
  <analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>

3.自定义域。指定域的类型的自定义的fieldtype.
在schema.xml中加入

<field name="item_title" type="text_ik" indexed="true" stored="true"/>
<field name="item_sell_point" type="text_ik" indexed="true" stored="true"/>
<field name="item_price"  type="long" indexed="true" stored="true"/>
<field name="item_image" type="string" indexed="false" stored="true" />
<field name="item_category_name" type="string" indexed="true" stored="true" />
<field name="item_desc" type="text_ik" indexed="true" stored="false" />

<field name="item_keywords" type="text_ik" indexed="true" stored="false" multiValued="true"/>
<copyField source="item_title" dest="item_keywords"/>
<copyField source="item_sell_point" dest="item_keywords"/>
<copyField source="item_category_name" dest="item_keywords"/>
<copyField source="item_desc" dest="item_keywords"/>

4.重新启动tomcat即可。
solr服务搭建 _ Java侠

作者:网名哈哈镜
来源链接:https://blog.csdn.net/u010317829/article/details/53301389

标签: Solr

“solr服务搭建” 的相关文章

solr 3.5 配置及应用(二)

在 solr 3.5 配置及应用(一) 讲过一了 solr 3.5的详细配置,本节我们讲利用solr 的客户端调用solr的应用了! 一、利用S...

solr 配置clustering

首先是在solrconfig.xml,添加  <searchComponent     name="clusteringC...

Solr 3.5 + Tomcat7 + mmseg4j + 搜狗词库 -配置并运行

机器上已安装 : Tomcat 7    jdk1.7    mysql 5.0 访问 http://www....

Solr+hbase方案

Solr+hbase方案

一、Solr+hbase方案 Solr是一个独立的企业级搜索应用server,它对并提供相似干Web-service的API接口。用户能够通过http请求,向搜索引擎...

真分布式SolrCloud+Zookeeper+tomcat搭建、索引Mysql数据库、IK中文分词器配置以及web项目中solr的应用(1)

真分布式SolrCloud+Zookeeper+tomcat搭建、索引Mysql数据库、IK中文分词器配置以及web项目中solr的应用(1)

***版权声明:本文为博主原创文章,转载请注明本文地址。http://www.cnblogs.com/o0Iris0o/p/5813856.html *** 内容介绍: 真分...

solr在linux中配置文件,solr安装与配置

pache Solr (读音: SOLer)是一个开源的搜索服务器。使用Java语言开发,主要基于HTTP和Apache Lucene实现。Apache S...

solr 5.3.1安装配置

solr 5.3.1安装配置

1、下载Solr5.3.1 http://mirror.bit.edu.cn/apache/lucene/solr/5.3.1/ wget http://mirro...

docker安装solr集群5.3.1

docker安装solr集群5.3.1

    docker-compose.yml: version: '3' services: zookeeper-A: imag...

solr8.2 环境搭建 配置中文分词器 ik-analyzer-solr8 详细步骤

solr8.2 环境搭建 配置中文分词器 ik-analyzer-solr8 详细步骤 作者:还是个孩子呢~ 来源链接:ht...

linux查看solr安装路径,在windows和linux下分别部署Solr服务

linux查看solr安装路径,在windows和linux下分别部署Solr服务

一、在windows下部署Solr服务 1、windows部署solr前的准备: jdk1.7+tomcat-7+solr-4.10.4 1...