Class SimpleQueryStringBuilder

java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<SimpleQueryStringBuilder>
org.elasticsearch.index.query.SimpleQueryStringBuilder
All Implemented Interfaces:
NamedWriteable, Writeable, ToXContent, ToXContentObject, QueryBuilder, Rewriteable<QueryBuilder>

public class SimpleQueryStringBuilder
extends AbstractQueryBuilder<SimpleQueryStringBuilder>
SimpleQuery is a query parser that acts similar to a query_string query, but won't throw exceptions for any weird string syntax. It supports the following:
  • '+' specifies AND operation: token1+token2
  • '|' specifies OR operation: token1|token2
  • '-' negates a single token: -token0
  • '"' creates phrases of terms: "term1 term2 ..."
  • '*' at the end of terms specifies prefix query: term*
  • '(' and ')' specifies precedence: token1 + (token2 | token3)
  • '~N' at the end of terms specifies fuzzy query: term~1
  • '~N' at the end of phrases specifies near/slop query: "term1 term2"~5

See: SimpleQueryStringQueryParser for more information.

This query supports these options:

Required: query - query text to be converted into other queries

Optional: analyzer - anaylzer to be used for analyzing tokens to determine which kind of query they should be converted into, defaults to "standard" default_operator - default operator for boolean queries, defaults to OR fields - fields to search, defaults to _all if not set, allows boosting a field with ^n For more detailed explanation of the query string syntax see also the online documentation.