es 5.2 数值类型与keyword做termquery
匿名 | 发布于2019年12月27日 | 阅读数:2878
对10w的文档
文档中两个字段 一个类型是keyword另一个是long
做term查询 没有must什么其他的东西
profile结果如下
数值类型会快????
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 110002,
"max_score" : 0.0,
"hits" : [ ]
},
"profile" : {
"shards" : [
{
"id" : "[DpRRXv7CQnazXxg_Lh_1Dg][keywordtest][0]",
"searches" : [
{
"query" : [
{
"type" : "BooleanQuery",
"description" : "+(ConstantScore(fieldNumber:[10000 TO 10000]))^0.0 #(ConstantScore(*:*))^0.0",
"time" : "22.92261400ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 28385,
"next_doc" : 22685169,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 110011,
"score_count" : 0,
"build_scorer" : 99039,
"advance" : 0,
"advance_count" : 0
},
"children" : [
{
"type" : "BoostQuery",
"description" : "(ConstantScore(fieldNumber:[10000 TO 10000]))^0.0",
"time" : "3.443096000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 7477,
"next_doc" : 3309273,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 110011,
"score_count" : 0,
"build_scorer" : 16325,
"advance" : 0,
"advance_count" : 0
},
"children" : [
{
"type" : "",
"description" : "fieldNumber:[10000 TO 10000]",
"time" : "0.01940100000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 6,
"match_count" : 0,
"create_weight" : 1214,
"next_doc" : 7868,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 302,
"score_count" : 0,
"build_scorer" : 10010,
"advance" : 0,
"advance_count" : 0
}
}
]
},
{
"type" : "BoostQuery",
"description" : "(ConstantScore(*:*))^0.0",
"time" : "8.848347000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 3050,
"next_doc" : 0,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 0,
"score_count" : 0,
"build_scorer" : 6106,
"advance" : 8729170,
"advance_count" : 110011
},
"children" : [
{
"type" : "MatchAllDocsQuery",
"description" : "*:*",
"time" : "2.964521000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 704,
"next_doc" : 0,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 0,
"score_count" : 0,
"build_scorer" : 2478,
"advance" : 2851318,
"advance_count" : 110011
}
}
]
}
]
}
],
"rewrite_time" : 51252,
"collector" : [
{
"name" : "CancellableCollector",
"reason" : "search_cancelled",
"time" : "10.26371700ms",
"children" : [
{
"name" : "TotalHitCountCollector",
"reason" : "search_count",
"time" : "3.861015000ms"
}
]
}
]
}
],
"aggregations" : [ ]
}
]
}
}
文档中两个字段 一个类型是keyword另一个是long
做term查询 没有must什么其他的东西
profile结果如下
数值类型会快????
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 110002,
"max_score" : 0.0,
"hits" : [ ]
},
"profile" : {
"shards" : [
{
"id" : "[DpRRXv7CQnazXxg_Lh_1Dg][keywordtest][0]",
"searches" : [
{
"query" : [
{
"type" : "BooleanQuery",
"description" : "+(ConstantScore(fieldNumber:[10000 TO 10000]))^0.0 #(ConstantScore(*:*))^0.0",
"time" : "22.92261400ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 28385,
"next_doc" : 22685169,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 110011,
"score_count" : 0,
"build_scorer" : 99039,
"advance" : 0,
"advance_count" : 0
},
"children" : [
{
"type" : "BoostQuery",
"description" : "(ConstantScore(fieldNumber:[10000 TO 10000]))^0.0",
"time" : "3.443096000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 7477,
"next_doc" : 3309273,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 110011,
"score_count" : 0,
"build_scorer" : 16325,
"advance" : 0,
"advance_count" : 0
},
"children" : [
{
"type" : "",
"description" : "fieldNumber:[10000 TO 10000]",
"time" : "0.01940100000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 6,
"match_count" : 0,
"create_weight" : 1214,
"next_doc" : 7868,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 302,
"score_count" : 0,
"build_scorer" : 10010,
"advance" : 0,
"advance_count" : 0
}
}
]
},
{
"type" : "BoostQuery",
"description" : "(ConstantScore(*:*))^0.0",
"time" : "8.848347000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 3050,
"next_doc" : 0,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 0,
"score_count" : 0,
"build_scorer" : 6106,
"advance" : 8729170,
"advance_count" : 110011
},
"children" : [
{
"type" : "MatchAllDocsQuery",
"description" : "*:*",
"time" : "2.964521000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 9,
"match_count" : 0,
"create_weight" : 704,
"next_doc" : 0,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 0,
"score_count" : 0,
"build_scorer" : 2478,
"advance" : 2851318,
"advance_count" : 110011
}
}
]
}
]
}
],
"rewrite_time" : 51252,
"collector" : [
{
"name" : "CancellableCollector",
"reason" : "search_cancelled",
"time" : "10.26371700ms",
"children" : [
{
"name" : "TotalHitCountCollector",
"reason" : "search_count",
"time" : "3.861015000ms"
}
]
}
]
}
],
"aggregations" : [ ]
}
]
}
}
2 个回复
匿名用户
赞同来自:
"hits" : {
"total" : 110002,
"max_score" : 0.0,
"hits" : [ ]
},
"profile" : {
"shards" : [
{
"id" : "[Q0tFE--VQb6e5FplV49uLg][keywordtest][0]",
"searches" : [
{
"query" : [
{
"type" : "BooleanQuery",
"description" : "+(ConstantScore(fieldKeyword:10000))^0.0 #(ConstantScore(*:*))^0.0",
"time" : "62.45016700ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 3,
"match_count" : 0,
"create_weight" : 91950,
"next_doc" : 61706316,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 110005,
"score_count" : 0,
"build_scorer" : 541892,
"advance" : 0,
"advance_count" : 0
},
"children" : [
{
"type" : "BoostQuery",
"description" : "(ConstantScore(fieldKeyword:10000))^0.0",
"time" : "23.01265400ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 3,
"match_count" : 0,
"create_weight" : 28035,
"next_doc" : 22709907,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 110005,
"score_count" : 0,
"build_scorer" : 164703,
"advance" : 0,
"advance_count" : 0
},
"children" : [
{
"type" : "TermQuery",
"description" : "fieldKeyword:10000",
"time" : "9.629793000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 3,
"match_count" : 0,
"create_weight" : 5028,
"next_doc" : 9388262,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 110005,
"score_count" : 0,
"build_scorer" : 126494,
"advance" : 0,
"advance_count" : 0
}
}
]
},
{
"type" : "BoostQuery",
"description" : "(ConstantScore(*:*))^0.0",
"time" : "16.73188800ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 3,
"match_count" : 0,
"create_weight" : 8029,
"next_doc" : 0,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 0,
"score_count" : 0,
"build_scorer" : 14305,
"advance" : 16599545,
"advance_count" : 110005
},
"children" : [
{
"type" : "MatchAllDocsQuery",
"description" : "*:*",
"time" : "5.430918000ms",
"breakdown" : {
"score" : 0,
"build_scorer_count" : 3,
"match_count" : 0,
"create_weight" : 1126,
"next_doc" : 0,
"match" : 0,
"create_weight_count" : 1,
"next_doc_count" : 0,
"score_count" : 0,
"build_scorer" : 3713,
"advance" : 5316070,
"advance_count" : 110005
}
}
]
}
]
}
],
"rewrite_time" : 85234,
"collector" : [
{
"name" : "CancellableCollector",
"reason" : "search_cancelled",
"time" : "15.60589600ms",
"children" : [
{
"name" : "TotalHitCountCollector",
"reason" : "search_count",
"time" : "5.316156000ms"
}
]
}
]
}
],
"aggregations" : [ ]
}
]
}
}
xiaoyanghapi - Elasticsearch 爱好者
赞同来自: