是否可以查询 Elasticsearch 并为其提供一系列字符串?
我想像的东西:
样本映射:
{
"resource" : {
"properties" : {
"Title" : {
"type" : "string"
},
"type_" : {
"index" : "not_analyzed",
"type" : "string"
},
"Summary" : {
"format" : "dateOptionalTime",
"type" : "date"
}
}
}
}
示例查询:
{
"size" : 10,
"query" : {
"filtered" : {
"query" : {
"bool" : {
"should" : [ {
"text" : {
"Title" : {
"query" : "AAA",
"type" : "phrase_prefix"
}
}
}, {
"range" : {
"Title" : {
"from" : "BBB",
"to" : "CCC",
"include_lower" : true,
"include_upper" : true
}
}
} ],
"minimum_number_should_match" : 1
}
},
"filter" : {
"and" : {
"filters" : [{
"or" : {
"filters" : [ {
"term" : {
"type_" : "personType"
}
} ]
}
} ]
}
}
}
}
}
数据索引:
具有Titles
“AAA”、“BBB”、“CCC”、“DDD”的资源
带有“AAA”的结果
资源Title
(范围未选择“BBB”和“CCC”)
任何帮助表示赞赏