Sets the source of the request as a json string.
Sets the source of the request as a json string. Allows setting other parameters. Unlike rawQuery, setExtraSource is parsed at the "root" level Query must be valid json beginning with '{' and ending with '}'. Field names must be double quoted.
Example:
search in "*" types("users", "tweets") limit 5 extraSource { """{ "query": { "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } } }""" } searchType SearchType.Scan
Adds a match all query to this search definition
Adds a single prefix query to this search
Adds a single prefix query to this search
- the field and prefix value
this
Adds a single string query to this search
Adds a single string query to this search
the query string
Expects a query in json format and sets the query of the search request.
Expects a query in json format and sets the query of the search request. i.e. underneath a "query" field if referencing HTTP API Query must be valid json beginning with '{' and ending with '}'. Field names must be double quoted.
Example:
search in "*" types("users", "tweets") limit 5 rawQuery { """{ "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } }""" } searchType SearchType.Scan
This method introduces zero or more script field definitions into the search construction
This method introduces zero or more script field definitions into the search construction
zero or more ScriptFieldDefinition instances
this, an instance of SearchDefinition
Sets the source of the request as a json string.
Sets the source of the request as a json string. Note, setting anything other
than the search type will cause this source to be overridden, consider using
#setExtraSource(String)
.
Unlike rawQuery, setExtraSource is parsed at the "root" level Query must be valid json beginning with '{' and ending with '}'. Field names must be double quoted.
Example:
search in "*" types("users", "tweets") limit 5 extraSource { """{ "query": { "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } } }""" } searchType SearchType.Scan
Adds a new suggestion to the search request, which can be looked up in the response using the name provided.
(Since version 5.0.0) Renamed to storedFields
(Since version 5.0.0) Set fuzzy query using query(fuzzyQuery(...)) syntax
Adds a single regex query to this search
Adds a single regex query to this search
- the field and regex value
this
(Since version 5.0.0) use regexQuery(...)
(Since version 5.0.0) use sortBy
(Since version 5.0.0) use termQuery()
(Since version 5.0.0) use termQuery()