MCPcopy Create free account
hub / github.com/olivere/elastic / DefaultOperator

Method DefaultOperator

search_queries_query_string.go:99–102  ·  view source on GitHub ↗

DefaultOperator sets the boolean operator of the query parser used to parse the query string. In default mode (OR) terms without any modifiers are considered optional, e.g. "capital of Hungary" is equal to "capital OR of OR Hungary". In AND mode, terms are considered to be in conjunction. The abov

(operator string)

Source from the content-addressed store, hash-verified

97// In AND mode, terms are considered to be in conjunction. The above mentioned
98// query is then parsed as "capital AND of AND Hungary".
99func (q *QueryStringQuery) DefaultOperator(operator string) *QueryStringQuery {
100 q.defaultOperator = operator
101 return q
102}
103
104// Analyzer is an optional analyzer used to analyze the query string.
105// Note, if a field has search analyzer defined for it, then it will be used

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected