5

嗨,我正在尝试让查询工作,但我不明白如何让它工作

我想搜索所有这样的匹配词

$term = +短语 +短语 +短语

但是如果短语中有一个空格,我如何将短语作为一个整体进行匹配,而不是将单词分成单独的搜索项?

"query" : {
    "query_string" : {
        "query" : "' . $term . '"
    }
}
4

1 回答 1

4

您是否尝试过类似 +"this is my phrase" +"Another one" 之类的方法?

还请查看短语查询(在匹配查询文档中):http ://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html

于 2012-11-13T07:59:08.337 回答