1. match_phase
match_phase
习语匹配,查询确切的phase
,在对查询字段定义了分词器的情况下,会使用分词器对输入进行分词,然后返回满足下述两个条件的document
:
1.match_phase中的所有term都出现在待查询字段之中
2.待查询字段之中的所有term都必须和match_phase具有相同的顺序
{ "foo":"I just said hello world" }
{ "foo":"Hello world" }
{ "foo":"World Hello" }
使用match_phase
,会返回前两条文档:
{
"query": {
"match_phrase": {
"foo": "Hello World"
}
}
}
2. match
match
模糊匹配,先对输入进行分词,对分词后的结果进行查询,文档只要包含match
查询条件的一部分就会被返回。