ElasticSearch 经常使用设置

 

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

http://localhost:9200/

 

 进入Head的方式2.2 的在node

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

 

进入6.几的方式app

先要本身下载,把Head拷贝进去目录。而后修改配置文件,ide

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

grunt server

效果如图:spa

最后在9100端口进入Headcode

http://localhost:9100

 

 

 

分词查找orm

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

 

查看Mapping的方法server

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

 

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

找到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"

                }
            }
        }
    }
}
相关文章
相关标签/搜索