ElasticSearch之QueryBuilders

1.termsQuery
A filer for a field based on several terms matching on any of them
翻译过来:基于以下几个方面对其中任何匹配一个字段的过滤器;
termQuery中的value有以下情况:
a.若value为汉字,则大部分情况下,只能为一个汉字;
b.若value为英文,则是一个单词;
2.matchQuery
Creates a match query with type “BOOLEAN” for the provided field name and text.
翻译过来:创建一个匹配查询与所提供的字段名称和文本类型“布尔”。
模糊查询
3.matchPhrasePrefixQuery与matchPhraseQuery
调用matchPhrasePrefixQuery时,text为中文,那么很大可能是一种状况:你会发现,matchPhraseQuery和matchPhrasePrefixQuery没有任何差别。而当text为英文时,差别就显现出来了:matchPhraseQuery的text是一个英文单词,而matchPhrasePrefixQuery的text则无这一约束,你可以从一个英文单词中抽几个连接在一起的字母进行查询。

原文地址:https://www.cnblogs.com/luweiwei/p/5320792.html