您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
elasticSearch期限等级查询term
发布时间:2021-09-06 22:08:32编辑:雪饮阅读()
elasticSearch中期限等级查询主要处理结构化数据,如数字,日期和枚举。
term是代表完全匹配,即不进行分词器分析,文档中必须包含整个搜索的词汇,例如:
请求体:
{
"query":{
"term":{"zip":"176115"}
}
}
响应体:
{
"took": 22,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1.3862942,
"hits": [
{
"_index": "schools",
"_type": "school",
"_id": "1",
"_score": 1.3862942,
"_source": {
"name": "Central School",
"description": "CBSE Affiliation",
"street": "Nagan",
"city": "paprola",
"state": "HP",
"zip": "176115",
"location": [
31.8955385,
76.8380405
],
"fees": 2000,
"tags": [
"Senior Secondary",
"beautiful campus"
],
"rating": "3.5"
}
}
]
}
}
而像如普通的match查询就会将待查询字串进行分词。比如
match
最简单的一个match例子:
查询和"我的宝马多少马力"这个查询语句匹配的文档。
{
"query": {
"match": {
"content": {
"query": "我的宝马多少马力"
}
}
}
}
上面的查询匹配就会进行分词,比如"宝马多少马力"会被分词为"宝马 多少 马力", 所有有关"宝马 多少 马力", 那么所有包含这三个词中的一个或多个的文档就会被搜索出来。
并且根据lucene的评分机制(TF/IDF)来进行评分。
关键字词:elasticSearch,期限等级查询,term
相关文章
- elasticSearch查询字符串查询(query_string)
- elasticSearch的multi_match查询(指定多个字段查询)
- elasticSearch匹配查询
- elasticSearch集群健康状态变黄yellow及Unassigned问
- elasticSearch查询DSL-匹配所有查询
- elasticSearch节点hot_threads
- elasticSearch集群api-节点统计
- elasticSearch群集更新设置api参数flat_settings的使
- elasticSearch群集更新设置(transient)
- elasticSearch集群获取设置api与群集更新设置(persist