match查询会先对搜索词进行分词,分词完毕后再逐个对分词结果进行匹配,相对于term的精确搜索,match是分词匹配搜索 两者查询的结果构成 query查出来的结果包括数据表里面符合条件的文档信息以及相关度得分(_score) filter查出来的结果要么是数据表里面符合条件的文档信息,要么为null,并且不会计算相关度得分 查询过程 这里以...
{ "took" : 792, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 3, "relation" : "eq" }, "max_score" : 0.15120466, "hits" : [ { "_index" : "demo", "_type" : "_doc"...
{ "value" : 6, "relation" : "eq" }, "max_score" : 0.18812019, "hits" : [ { "_index" : "people2", "_type" : "_doc", "_id" : "6", "_score" : 0.18812019, "_source" : { "title" : "Shane Shane Shane Connelly Connelly Connelly" } }, { "_index" : "people2", "...
{ "took": 19, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": 1, "max_score": 1, "hits": [ { "_index": "yx", "_type": "goods", "_id": "lNC7KYUB35ub5htYEZMU", "_score": 1, "_source":...
每个结果还有一个 _score ,它衡量了文档与查询的匹配程度。默认情况下,首先返回最相关的文档结果,就是说,返回的文档是按照 _score 降序排列的。 max_score 值是与查询所匹配文档的 _score 的最大值。 took编辑 took值告诉我们执行整个搜索请求耗费了多少毫秒。
{"took":2,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":10000,"relation":"gte"},"max_score":null,"hits":[]},"aggregations":{"dest":{"doc_count_error_upper_bound":0,"sum_other_doc_count":7605,"buckets":[{"key...
"max_score" : 1.0,//匹配到的最大分值"hits" :[//这里就是我们具体的搜索结果,是一个JSON文档数组] } } 2.query子句 query子句主要用来编写类似SQL的Where语句,支持布尔查询(and/or)、IN、全文搜索、模糊匹配、范围查询(大于小于)。 3.aggs子句 ...
{ "took": 6, "timed_out": false, "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 2, "relation": "eq" }, "max_score": 2.0296195, "hits": [ { "_index": "gibberish_index", "_id": "4", "_score": 2.0296...
max_score:最高的匹配程度,本例是1.0。 hits:返回的记录组成的数组。 返回的记录中,每条记录都有一个_score字段,表示匹配的程序,默认是按照这个字段降序排列。 4.2 全文搜索 Elastic 的查询非常特别,使用自己的查询语法,要求 GET 请求带有数据体 代码语言:txt ...
{ "took" : 10, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : 2, "max_score" : 1.0, "hits" : [ { "_index" : "product_info", "_type" : "products", "_id" : "WLvWYXAB8Rql5AUxLqUU...