The Open API specification for Synapse is now available for download!

Download Open API Spec

QueryStringQuery

org.sagebionetworks.repo.model.search.dsl.QueryStringQuery

A query_string full-text clause — the full Lucene query syntax (column prefixes such as title: wind, AND/OR/NOT, grouping, ranges, ~ fuzziness, ^ boosts, /regex/). The operators have no precedence, so parenthesize any expression that mixes AND and OR. Every column named in query, fields and default_field is resolved against the index schema, and an unknown column is rejected. Inside query, a column name containing white space or one of + - ! ( ) : ^ [ ] " { } ~ * ? \ / must escape that character with a backslash (e.g. sample\ id: S-1); the all-columns prefix *: is not supported, and _exists_: takes a single column name.

Field Type Description
boost NUMBER Optional. Multiplier for the relevance score of this clause. Default 1.0.
_name STRING Optional. Label echoed back in matched-queries metadata.
minimum_should_match OBJECT Optional. Minimum number of terms a document must match. An integer or a percentage / formula string.
query STRING Required. The text to search, which may contain expressions in the query-string syntax.
fields ARRAY<OBJECT> Optional. The columns to search, at most 1024. Each entry may carry a ^boost suffix (e.g. ["title^4", "description"]); column-name wildcards are not supported. Defaults to default_field.
default_field STRING Optional. The column searched by terms that carry no column prefix; column-name wildcards are not supported. When neither this nor fields is given, every indexed column is searched. The number of columns multiplied by the number of terms may not exceed 1024 (the OpenSearch indices.query.bool.max_clause_count setting).
default_operator STRING Optional. Whether all terms (AND) or only one term (OR) must match when the query contains several terms with no operator between them. With OR, to be is interpreted as to OR be; with AND, as to AND be. Default OR.
type STRING Optional. How the per-column matches are combined when fields lists more than one column: best_fields (default), most_fields, cross_fields, phrase, phrase_prefix, or bool_prefix.
analyze_wildcard BOOLEAN Optional. Whether OpenSearch should attempt to analyze wildcard terms. Default false.
auto_generate_synonyms_phrase_query BOOLEAN Optional. Whether to create a match-phrase query automatically for multi-term synonyms. For example, with the synonyms ba, batting average, a search for ba is ba OR "batting average" when true and ba OR (batting AND average) when false. Default true.
enable_position_increments BOOLEAN Optional. When true, the resulting queries are aware of position increments, which matters when the removal of stop words leaves an unwanted gap between terms. Default true.
fuzziness STRING Optional. The number of character edits (insert, delete, substitute) that it takes to change one word to another when deciding whether a ~ term matched; for example, the distance between wined and wind is 1. A non-negative integer or AUTO. The default, AUTO, picks the edit distance from the term's length; AUTO:[low],[high] customizes the length boundaries, and plain AUTO means AUTO:3,6: terms of 0–2 characters must match exactly, terms of 3–5 characters allow 1 edit, and terms of 6 or more characters allow 2 edits.
fuzzy_max_expansions INTEGER Optional. The maximum number of terms a fuzzy term can expand to: a fuzzy term expands to the indexed terms within the fuzziness distance, and those terms are then matched. Default and maximum 50; a larger value is rejected.
fuzzy_prefix_length INTEGER Optional. Number of leading characters left unchanged when fuzzy matching.
fuzzy_transpositions BOOLEAN Optional. When true, a swap of two adjacent characters counts as one edit alongside the insert, delete and substitute edits of fuzziness. For example, the distance between wind and wnid is 1 when true and 2 when false. Default true.
lenient BOOLEAN Optional. When true, data type mismatches between the query and a column are ignored; for example, a query of 8.2 could match a column of type float. Default false.
max_determinized_states INTEGER Optional. The maximum number of states (a measure of complexity) Lucene may create for a /regex/ term (e.g. /wind.+?/); a larger number allows regular expressions that use more memory. Default and maximum 10000; a larger value is rejected.
phrase_slop NUMBER Optional. The maximum number of words allowed between the matched words of a quoted phrase. With 2, up to two words may appear between matched words; transposed words have a slop of 2. Default 0 (the matched words must be adjacent).
quote_field_suffix STRING Optional. A suffix appended to the column searched by quoted (exact) portions of the query, so they can be matched with a different analysis than unquoted terms. For example, with .keyword, title: "wind rises" is matched against the unanalyzed value of the title column.
rewrite STRING Optional. How multi-term queries are rewritten and scored: constant_score (default), scoring_boolean, constant_score_boolean, top_terms_N, top_terms_boost_N, or top_terms_blended_freqs_N.
time_zone STRING Optional. The UTC offset (e.g. -08:00) or time zone ID (e.g. America/Los_Angeles) used to interpret dates in range expressions, such as release_date: [2012-01-01 TO 2014-01-01]. Default UTC.