博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ElasticSearch 常用设置
阅读量:4622 次
发布时间:2019-06-09

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

 

2.2.0的启动和6.几 启动路径、端口一样,但是进入Head的路径不一样

http://localhost:9200/

 

 进入Head的方式2.2 的在

http://localhost:9200/_plugin/head/

 

进入6.几的方式

先要自己下载,把Head拷贝进去目录。然后修改配置文件,

然后,在head源代码目录下启动nodejs:

grunt server

效果如图:

最后在9100端口进入Head

http://localhost:9100

 

 

 

分词查找

http://localhost:9200/_analyze?analyzer=ik_max_word&&text=中华人民共和国

 

查看Mapping的方法

http://127.0.0.1:9200/jlindex/_mapping?pretty

 

通过Head的复合查询设置Mapping(文本禁用分词)

找到Head的复合查询部分

 

在查询第一行填入地址和要创建索引的名称,例如索引的名称是jlindex

 

 

另外,查询下左边栏位置空,右边栏位因为是新增索引和设置Mapping,所以设置为POST

把要提交的Mapping粘贴进去,点击提交按钮即可完成新建索引的Mapping

 

 

{    "mappings": {        "saledatatype": {            "properties": {                "FYear": {                    "type": "string",                    "index": "not_analyzed"                },                "FQuarter": {                    "type": "string",                    "index": "not_analyzed"                },                "FMonth": {                    "type": "string",                    "index": "not_analyzed"                },                "FDate": {                    "type": "date",                    "format": "strict_date_optional_time||epoch_millis"                },                "City": {                    "type": "string",                    "index": "not_analyzed"                },                "CustomerName": {                    "type": "string",                    "index": "not_analyzed"                },                "FAmount": {                    "type": "double"                },                "FItemClassID": {                    "type": "long"                },                "FItemID": {                    "type": "long"                },                "FItemID1": {                    "type": "long"                },                "FItemID2": {                    "type": "long"                },                "FItemID3": {                    "type": "long"                },                "FItemID4": {                    "type": "long"                },                "FItemID5": {                    "type": "long"                },                "FItemID6": {                    "type": "long"                },                "FName": {                    "type": "string",                    "index": "not_analyzed"                },                "FName1": {                    "type": "string",                    "index": "not_analyzed"                },                "FName2": {                    "type": "string",                    "index": "not_analyzed"                },                "FName3": {                    "type": "string",                    "index": "not_analyzed"                },                "FName4": {                    "type": "string",                    "index": "not_analyzed"                },                "FName5": {                    "type": "string",                    "index": "not_analyzed"                },                "FName6": {                    "type": "string",                    "index": "not_analyzed"                },                "FNumber": {                    "type": "string",                    "index": "not_analyzed"                },                "FNumber1": {                    "type": "string",                    "index": "not_analyzed"                },                "FNumber2": {                    "type": "string",                    "index": "not_analyzed"                },                "FNumber3": {                    "type": "string",                    "index": "not_analyzed"                },                "FNumber4": {                    "type": "string",                    "index": "not_analyzed"                },                "FNumber5": {                    "type": "string",                    "index": "not_analyzed"                },                "FNumber6": {                    "type": "string",                    "index": "not_analyzed"                },                "FQTy": {                    "type": "double"                },                "ItemName": {                    "type": "string",                    "index": "not_analyzed"                },                "ItemNumber": {                    "type": "string",                    "index": "not_analyzed"                },                "Province": {                    "type": "string",                    "index": "not_analyzed"                }            }        }    }}

 

 

 设置IK分词

{    "mappings": {        "saledatatype": {            "properties": {                "City": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "CustomerName": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FAmount": {                    "type": "double"                },                "FDate": {                    "type": "date",                    "format": "strict_date_optional_time||epoch_millis"                },                "FItemClassID": {                    "type": "long"                },                "FItemID": {                    "type": "long"                },                "FItemID1": {                    "type": "long"                },                "FItemID2": {                    "type": "long"                },                "FItemID3": {                    "type": "long"                },                "FItemID4": {                    "type": "long"                },                "FItemID5": {                    "type": "long"                },                "FItemID6": {                    "type": "long"                },                "FName": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FName1": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FName2": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FName3": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FName4": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FName5": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FName6": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FNumber": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FNumber1": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FNumber2": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FNumber3": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FNumber4": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FNumber5": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FNumber6": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "FQTy": {                    "type": "double"                },                "ItemName": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "ItemNumber": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                },                "Province": {                    "type": "string",                    "analyzer": "ik_max_word",                    "search_analyzer": "ik_max_word"                }            }        }    }}

 

转载于:https://www.cnblogs.com/Bruce_H21/p/8954428.html

你可能感兴趣的文章
Windows下手动安装redis服务
查看>>
把 MongoDB 当成是纯内存数据库来使用(Redis 风格)
查看>>
PyTorch 1.0 中文官方教程:使用ONNX将模型从PyTorch传输到Caffe2和移动端
查看>>
LeetCode 4Sum
查看>>
BBC-The Race and a quiz
查看>>
大端小端
查看>>
IntelliJ IDEA 把java项目导出成可执行的jar
查看>>
DynamicReports
查看>>
鼠标经过图像改变实现
查看>>
每日站立会议个人博客五
查看>>
ddd
查看>>
死磕 java同步系列之AQS起篇
查看>>
利用Lucene把文本的字体格式进行改动,然后输出到一个新的文件里
查看>>
[Openstack] Expecting an auth URL via either --os-auth-url or env[OS_AUTH_URL]
查看>>
How to Create Modifiers Using the API QP_MODIFIERS_PUB.PROCESS_MODIFIERS
查看>>
待飞笔记(第一天 )
查看>>
解惑好文:移动端H5页面高清多屏适配方案
查看>>
traefik添加多证书
查看>>
PhantomJs 笔记
查看>>
js设计模式--语言类型
查看>>