标签:dynamic 日期格式 typename 基于 ppi 映射 入库 允许 字段
使用google插件Postman
发送方式为PUT,url地址:
192.168.2.11:9200/IndexName
文本raw,数据为json格式
{
"settings":{
"number_of_shards":5,
"number_of_replicas":1
},
"mappings":{
"TypeName":{
"dynamic":"strict",
"properties":{
"tableId":{"type":"string","store":"yes","index":"not_analyzed"},
"title":{"type":"string","store":"yes","index":"analyzed","analyzer": "ik_max_word","search_analyzer": "ik_max_word"},
"author":{"type":"string","store":"yes","index":"analyzed","analyzer": "ik_max_word","search_analyzer": "ik_max_word"},
"summary":{"type":"string","store":"yes","index":"analyzed","analyzer": "ik_max_word","search_analyzer": "ik_max_word"},
"contextSrc":{"type":"string","store":"yes","index":"not_analyzed","ignore_above": 100},
"context":{"type":"string","store":"yes","index":"analyzed","analyzer": "ik_max_word","search_analyzer": "ik_max_word"},
"keywords":{"type":"string","store":"yes","index":"analyzed","analyzer": "ik_max_word","search_analyzer": "ik_max_word"},
"publishDate":{"type":"string","store":"yes","index":"not_analyzed"},
"createTime":{"type":"string","store":"yes","index":"not_analyzed"},
"modifyTime":{"type":"string","store":"yes","index":"not_analyzed"},
"deleteTime":{"type":"string","store":"yes","index":"not_analyzed"},
"url":{"type":"string","store":"yes","index":"not_analyzed"},
"isDeleted":{"type":"string","store":"yes","index":"not_analyzed"}
}
}
}
}
属性说明:
properties表示表的字段
ignore_above
的字符串,analyzer 不会进行处理;所以就不会索引起来。导致的结果就是最终搜索引擎搜索不到了。这个选项主要对 not_analyzed
字段有用,这些字段通常用来进行过滤、聚合和排序。而且这些字段都是结构化的,所以一般不会允许在这些字段中索引过长的项。标签:dynamic 日期格式 typename 基于 ppi 映射 入库 允许 字段
原文地址:http://www.cnblogs.com/sunny3096/p/7504630.html