查询中的弹性搜索ORing和ANDing

时间:2017-02-01 07:05:31

标签: elasticsearch

我想在弹性搜索查询中使用ORingANDing。我做了父 - 孩子映射。我使用查询:

{
  "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
                          }
                        }
                      }
                  }
                }
            }
          ]
      }
    }
}

提前致谢..

0 个答案:

没有答案