当前位置: 移动技术网 > 科技>人工智能>云计算 > ElasticSearch6.x学习笔记:JavaAPI进行全文查询

ElasticSearch6.x学习笔记:JavaAPI进行全文查询

2018年02月11日  | 移动技术网科技  | 我要评论

1、全文查询概述

The high-level full text queries are usually used for running full text queries on full text fields like the body of an email. They understand how the field being queried is analyzed and will apply each field’s analyzer (or search_analyzer) to the query string before executing.

2、match query

The standard query for performing full text queries, including fuzzy matching and phrase or proximity queries.

QueryBuilder query=QueryBuilders.matchQuery(
        "name",                                              
        "kimchy elasticsearch"); 

3、multi_match query

The multi-field version of the match query.

QueryBuilder query=QueryBuilders.multiMatchQuery(
        "kimchy elasticsearch",                              
        "user", "message");

4、common_terms query

A more specialized query which gives more preference to uncommon words.

QueryBuilder query=QueryBuilders.commonTermsQuery("name", "kimchy");  

5、query_string query

Supports the compact Lucene query string syntax, allowing you to specify AND|OR|NOT conditions and multi-field search within a single query string. For expert users only.

QueryBuilder query=QueryBuilders.queryStringQuery("+kimchy -elasticsearch");

6、simple_query_string

A simpler, more robust version of the query_string syntax suitable for exposing directly to users.

QueryBuilder query=QueryBuilders.simpleQueryStringQuery("+kimchy -elasticsearch");

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网