使用solr进行配置文件
我现在使用的是一个已经搭建好的solr环境下进行的测试:
第一步,需要配置solrhome中的一个配置文件schema.xml

配置内容如下,上面配置的是IK分词器,下面是配置完成的域.

因为我在这个需要使用的solr进行全文检索的只有这几个重要的字段.
然后内容如下:
<!-- IKAnalyzer-->
<fieldType name="text_ik" class="solr.TextField">
<analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
<!--IKAnalyzer Field-->
<field name="content_ik" type="text_ik" indexed="true" stored="true" />
<!--product-->
<field name="product_name" type="text_ik" indexed="true" stored="true"/>
<field name="product_price" type="float" indexed="true" stored="true"/>
<field name="product_description" type="text_ik" indexed="true" stored="false" />
<field name="product_picture" type="string" indexed="false" stored="true" />
<field name="product_catalog_name" type="string" indexed="true" stored="true" />
<!--关键词 增加搜索范围 商品名称商品描述-->
<field name="product_keywords" type="text_ik" indexed="true" stored="false" multiValued="true"/>
<copyField source="product_name" dest="product_keywords"/>
<copyField source="product_description" dest="product_keywords"/>
<field name="item_goodsid" type="long" indexed="true" stored="true"/>
<field name="item_title" type="text_ik" indexed="true" stored="true"/>
<field name="item_price" type="double" indexed="true" stored="true"/>
<field name="item_image" type="string" indexed="false" stored="true" />
<field name="item_category" type="string" indexed="true" stored="true" />
<field name="item_seller" type="text_ik" indexed="true" stored="true" />
<field name="item_brand" type="string" indexed="true" stored="true" />
<field name="item_updatetime" type="date" indexed="true" stored="true" />
<!--复制域-->
<field name="item_keywords" type="text_ik" indexed="true" stored="false" multiValued="true"/>
<copyField source="item_title" dest="item_keywords"/>
<copyField source="item_category" dest="item_keywords"/>
<copyField source="item_seller" dest="item_keywords"/>
<copyField source="item_brand" dest="item_keywords"/>
<!--当我们需要动态扩充字段时,我们需要使用动态域-->
<dynamicField name="item_spec_*" type="string" indexed="true" stored="true" />
为什么要配置域?
域相当于数据库的表字段,用户存放数据,因此用户根据业务需要去定义相关的Field(域),一般来说,每一种对应着一种数据,用户对同一种数据进行相同的操作.
域的常用属性:
- name:指定域的名称
- type:指定域的类型
- indexed:是否索引
- stored:是否存储
- required:是否必须
- multiValued:是否多值
复制域的作用是什么?
复制域的作用在于将某一个Field中的数据复制到另一个域中.
动态域的作用是什么?
当我们需要动态扩充字段时,我们需要使用动态域.
使用solr进行配置文件的更多相关文章
- solr与.net系列课程(二)solr的配置文件及其含义
solr与.net系列课程(二)solr的配置文件及其含义 本节内容还是不会涉及到.net与数据库的内容,但是不要着急,这都是学时solr必学要掌握的东西,solr可不是像其他的dll文件一样,只需 ...
- zookeeper管理solr的配置文件
zookeeper可以管理solr和其他软件的配置文件.配置文件还是保存在linux服务器的磁盘上,但是不是改变solr读取solr/home配置的配置文件的位置. 现在solr/home配置文件的位 ...
- solr的配置文件及其含义
solr与.net系列课程(二)solr的配置文件及其含义 solr与.net系列课程(二)solr的配置文件及其含义 本节内容还是不会涉及到.net与数据库的内容,但是不要着急,这都是学时s ...
- springboot+solr
整合完DB层,cache层,开始整合solr. 注入SolrClient, package hello.configuration; import java.net.MalformedURLExcep ...
- 04 Apache Solr: 目录结构
通过前面的介绍,我们已经能够看到管理员界面并对Solr形成了一个感性的认识.本篇将在物理上深入了解Solr的安装目录结构和Solr示例的主目录结构. 安装目录结构 Solr 6.3.0安 ...
- Solr初始化源码分析-Solr初始化与启动
用solr做项目已经有一年有余,但都是使用层面,只是利用solr现有机制,修改参数,然后监控调优,从没有对solr进行源码级别的研究.但是,最近手头的一个项目,让我感觉必须把solrn内部原理和扩展机 ...
- 【Solr】Solr的安装部署
目录 Solr安装部署 Solr Web界面分析 回到顶部 solr安装和部署 solr下载 http://lucene.apache.org/ 安装solr,就是去部署它的war包,war包所在的位 ...
- 基于Solr的HBase多条件查询测试
背景: 某电信项目中采用HBase来存储用户终端明细数据,供前台页面即时查询.HBase无可置疑拥有其优势,但其本身只对rowkey支持毫秒级 的快 速检索,对于多字段的组合查询却无能为力.针对HBa ...
- Solr Cloud搭建
1:搭建tomcat 配置connector: server.xm文件中: <Connector port="8080"maxThreads="200" ...
随机推荐
- 百度Aip人脸识别之python代码
用python来做人脸识别代码量少 思路清晰, 在使用之前我们需要在我们的配置的编译器中通过pip install baidu-aip 即可 from aip import AipFace 就可以开 ...
- 进程池的同步与异步用法Pool
进程池的同步,如下程序: from multiprocessing import Pool import time import os def func(n): print('start 进程 %s' ...
- B - Battle City bfs+优先队列
来源poj2312 Many of us had played the game "Battle city" in our childhood, and some people ( ...
- IkAnalyzer2012FF_u1.jar免费下载
链接:https://pan.baidu.com/s/1P_0cdRLKJO4VIUTokvTS0g 提取码:qt3w
- js设计模式(四)---迭代器模式
定义: 迭代器模式是指提供一种方法,顺序访问一个聚合对象中的各个元素,而又不需要暴露该对象的内部表示,迭代器模式可以把迭代的过程从业务逻辑中分离出来,使用迭代器模式,即使不关心对象的内部构造,也可以按 ...
- php三级联动(html,php两个页面)
<!doctype html><html><head><meta charset="utf-8"><title>无标题文 ...
- Codeforces Round div2 #541 题解
codeforces Round #541 abstract: I构造题可能代码简单证明很难 II拓扑排序 III并查集 启发式排序,带链表 IV dp 处理字符串递推问题 V 数据结构巧用:于二叉树 ...
- 实时分析(在线查询),firehose---clickhouse
firehose---clickhouse 在Hive中适不适合像传统数据仓库一样利用维度建模hive新功能 Cube, Rollup介绍https://blog.csdn.net/moon_yang ...
- 【摘】Fiddler工具使用介绍
摘自:https://www.cnblogs.com/miantest/p/7289694.html Fiddler基础知识 Fiddler是强大的抓包工具,它的原理是以web代理服务器的形式进行工作 ...
- git 不能创建分支
git 不能创建分支,如下 fatal: cannot lock ref 'refs/heads/hotfix/aa': 'refs/heads/hotfix' exists; cannot crea ...