【发布时间】:2018-07-10 11:49:20
【问题描述】:
我想用简单的查询语法查询一个弹性索引。
我的查询:
{
"query": {
"simple_query_string" : {
"query": "25",
"fields" : ["product.size"]
}
}
}
没有返回任何结果,尽管字段中有一个具有匹配值的条目:
{
"took" : 869,
"timed_out" : false,
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"hits" : {
"total" : 97241,
"max_score" : 1.8576174,
"hits" : [
{
"_index" : "deviceinformation",
"_type" : "deviceinfo",
"_id" : "314043",
"_score" : 1.8576174,
"_source" : {
"baseinfo" : {
"material_no" : "314043",
"dimensional_drawing_nr" : "118600"
},
"product" : {
"size" : "25",
"range" : "I",
"type" : "MAC"
}
}]
}
我做错了什么?
编辑: 我正在使用 Elassandra 5.5.0.18 = Elasticsearch 5.5.0 + Cassandra 3.11.2 映射摘录:
{
"deviceinformation" : {
"mappings" : {
"deviceinfo" : {
"product" : {
"type" : "nested",
"cql_collection" : "singleton",
"cql_udt_name" : "product",
"properties" : {
"base_size" : {
"type" : "keyword",
"cql_collection" : "singleton"
},
"pressure_stage" : {
"type" : "keyword",
"cql_collection" : "singleton"
},
"range" : {
"type" : "keyword",
"cql_collection" : "singleton"
},
"size" : {
"type" : "keyword",
"cql_collection" : "singleton"
},
"type" : {
"type" : "keyword",
"cql_collection" : "singleton"
}
}
}
}
【问题讨论】:
-
您能否发布您正在使用的索引和 ES 版本的映射。查询对我来说工作正常。
-
我在最初的问题中添加了映射和版本