ElasticSearch新手。
我有文件在
index
:
myindex
在使用映射的弹性搜索中:
http://host:port/myindex/_mapping
{
"mappings":{
"properties": {
"en_US": {
"type": "keyword"
}
}
}
}
假设我的3个文档如下所示:
{
"product": "p1",
"subproduct": "p1.1"
}
{
"product": "p1",
"subproduct": "p1.2"
}
{
"product": "p2",
"subproduct": "p2.1"
}
现在,我正在查询单个子管道的使用
p1.1
用产品
p1
如下所示,工作正常:
http://host:port/myindex/_search
{
"query": {
"bool" : {
"must" : {
"term" : { "product" : "p1" }
},
"filter": {
"term" : { "subproduct" : "p1.1" }
}
}
}
}
我的问题是
:
如何在一个搜索查询中查询2个或多个子产品,如SupProducts
p1。1.
和
p1.2
副产品
p1
?
查询应返回所有子管道的列表
p1。1.
和子管道
p1。2.
具有
p1
产品