我想在弹性搜索查询中使用ORing
和ANDing
。我做了父 - 孩子映射。我使用查询:
{
"from" : 0, "size" : 100,
"query": {
"bool": {
"should": [
{
"query": {
"match_phrase": {
"question_title": {
"query": 'searchKey',
"slop": 3
}
}
}
},
{
"query": {
"has_parent": {
"type": "question_data",
"query": {
"match_phrase": {
"question_title": {
"query": 'searchKey',
"slop": 3
}
}
}
}
}
}
]
}
}
}
提前致谢..