1、配置managed-schema

<fieldType name="text_mmseg4j_simple" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<filter class="solr.SynonymGraphFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms-cn.txt"/>
<tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple"/>
</analyzer>
</fieldType>
<field name="text" type="text_mmseg4j_simple" termVectors="true" indexed="true" stored="true"/>

  2、同义词文件synonyms-cn.txt

  

# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License. #-----------------------------------------------------------------------
#some test synonym mappings unlikely to appear in real input text
aaafoo => aaabar
bbbfoo => bbbfoo bbbbar
cccfoo => cccbar cccbaz
fooaaa,baraaa,bazaaa # Some synonym groups specific to this example
GB,gib,gigabyte,gigabytes
MB,mib,megabyte,megabytes
Television, Televisions, TV, TVs
#notice we use "gib" instead of "GiB" so any WordDelimiterGraphFilter coming
#after us won't split it into two words. # Synonym mappings can be used for spelling correction too
pixima => pixma ideapad,ideacenter,lenovo,联想
china,中国,中华人民共和国,华夏,中国大陆

 下面两种方式都可以

联想,ideapad,ideacenter,lenovo
联想 => ideapad,ideacenter,lenovo

  3、索引文件搜索

    

    

    

												

solr6.6 配置同义词的更多相关文章

  1. solr6.6 配置拼音分词

    参考:solr6.6 配置同义词 1.下载拼音分析包 下载地址:pinyin.zip 解压后放在core下面的lib文件夹下面: 2.修改managed-schema配置文件 <fieldTyp ...

  2. [大数据]-Logstash-5.3.1的安装导入数据到Elasticsearch5.3.1并配置同义词过滤

    阅读此文请先阅读上文:[大数据]-Elasticsearch5.3.1 IK分词,同义词/联想搜索设置,前面介绍了ES,Kibana5.3.1的安装配置,以及IK分词的安装和同义词设置,这里主要记录L ...

  3. solr-用mmseg4j配置同义词索引和检索(IKanlyzer需要修改源码适应solr接口才能使用同义词功能)

    概念说明:同义词大体的意思是指,当用户输入一个词时,solr会把相关有相同意思的近义词的或同义词的term的语段内容从索引中取出,展示给用户,提高交互的友好性(当然这些同义词的定义是要在配置文件中事先 ...

  4. solr配置同义词,停止词,和扩展词库(IK分词器为例)

    定义 同义词:搜索结果里出现的同义词.如我们输入”还行”,得到的结果包括同义词”还可以”. 停止词:在搜索时不用出现在结果里的词.比如is .a .are .”的”,“得”,“我” 等,这些词会在句子 ...

  5. 转:solr6.0配置中文分词器IK Analyzer

    solr6.0中进行中文分词器IK Analyzer的配置和solr低版本中最大不同点在于IK Analyzer中jar包的引用.一般的IK分词jar包都是不能用的,因为IK分词中传统的jar不支持s ...

  6. 我与solr(六)--solr6.0配置中文分词器IK Analyzer

    转自:http://blog.csdn.net/linzhiqiang0316/article/details/51554217,表示感谢. 由于前面没有设置分词器,以至于查询的结果出入比较大,并且无 ...

  7. docker环境下solr6.0配置(中文分词+拼音)

    前言:这篇文章是基于之前的“linux环境下配置solr5.3详细步骤”(http://www.cnblogs.com/zhangyuan0532/p/4826740.html)进行扩展的.本篇的步骤 ...

  8. Solr6.5配置中文分词IKAnalyzer和拼音分词pinyinAnalyzer (二)

    之前在 Solr6.5在Centos6上的安装与配置 (一) 一文中介绍了solr6.5的安装.这篇文章主要介绍创建Solr的Core并配置中文IKAnalyzer分词和拼音检索. 一.创建Core: ...

  9. [大数据]-Fscrawler导入文件(txt,html,pdf,worf...)到Elasticsearch5.3.1并配置同义词过滤

    fscrawler是ES的一个文件导入插件,只需要简单的配置就可以实现将本地文件系统的文件导入到ES中进行检索,同时支持丰富的文件格式(txt.pdf,html,word...)等等.下面详细介绍下f ...

随机推荐

  1. 关于might_sleep的一点说明---CONFIG_DEBUG_ATOMIC_SLEEP【转】

    转自:http://blog.chinaunix.net/uid-23769728-id-3157536.html 这个函数我在看代码时基本上是直接忽略的(因为我知道它实际上不干什么事),不过因为内核 ...

  2. 解决Eclipse明明有错误,却不能显示错误红叉的方法,eclipse不能显示错误

    出现这情况的原因是因为java文件的错误太多,eclipse停止编译.解决方法如下 1.勾选自动编译功能 2.clean工程 3.取消“abort build when build path erro ...

  3. js面向对象编程(三)非构造函数的继承(转载)

    Javascript面向对象编程(三):非构造函数的继承 今天是最后一个部分,介绍不使用构造函数实现"继承". 一.什么是"非构造函数"的继承? 比如,现在有一 ...

  4. selenium 消息框元素定位处理

    以下内容来自于“风少”的博客 <元素定位:selenium消息框处理 (alert.confirm.prompt)> 基础普及 alert对话框 .细分三种,Alert,prompt,co ...

  5. [BZOJ2553][BeiJing2011]禁忌 dp+AC自动机+矩阵快速幂

    2553: [BeiJing2011]禁忌 Time Limit: 20 Sec  Memory Limit: 128 MBSec  Special JudgeSubmit: 1206  Solved ...

  6. IE8的 JS 引擎如此不堪?

    之前给客户做了个网站,其中有这么一个功能: 文章内容中,有指向某个图片的链接,链接内容为图片名称(文字),点击之后在页面上弹出该图片显示,图片可以为png,jpg,gif等. 于是,祭出了JQuery ...

  7. magento 开启模板路径提示

    1.进入后台system->configuration->,选择main Website 2.advanced->developer中,将Debug中的Template Path H ...

  8. IIS-CS0016未能写入文件错误解决方法

    使用IIS创建Workbench站点,运行在本地 Workbench主页显示错误,这个提示的错误信息其实是有误导人的,真的打开至c:\Windows\Microsoft.NET\Framework64 ...

  9. HDU 1014 Uniform Generator(最大公约数,周期循环)

    #include<iostream> #include <cstdio> #include <cstring> using namespace std; int m ...

  10. HDU 1015 Safecracker【数值型DFS】

    Safecracker Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...