diff --git a/search/opensearch_types.go b/search/opensearch_types.go index a8d1880021ab6bb5778e6fc9cf38379c6ca12822..d2ae209e460a78428a27aad81dfb2ba836b35753 100644 --- a/search/opensearch_types.go +++ b/search/opensearch_types.go @@ -48,6 +48,7 @@ type Query struct { MultiMatch *QueryMultiMatch `json:"multi_match,omitempty"` Bool *QueryBool `json:"bool,omitempty"` QueryString *QueryString `json:"query_string,omitempty"` + Wildcard *QueryNameValue `json:"wildcard,omitempty"` //https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html } type QueryMultiMatch struct { @@ -56,7 +57,8 @@ type QueryMultiMatch struct { } type QueryString struct { - Query string `json:"query" doc:"Text search with partial matches, using asterisk for optional or question mark for required wildcards before and/or after text"` + Query string `json:"query" doc:"Text search with partial matches, using asterisk for optional or question mark for required wildcards before and/or after text"` + Fields []string `json:"fields,omitempty" doc:"List of fields"` } // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html @@ -72,10 +74,15 @@ type QueryBool struct { type QueryNameValue map[string]QueryValue type QueryValue struct { - Query string `json:"query"` + Query string `json:"query,omitempty"` Operator string `json:"operator,omitempty"` //defaults to "or", accepted values: or|and Fuzziness string `json:"fuzziness,omitempty"` //https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness ZeroTermsQuery string `json:"zero_terms_query,omitempty"` + Value string `json:"value,omitempty"` //https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html +} + +func QueryValueTextValue(text string) QueryValue { + return QueryValue{Value: text} } func QueryValueText(text string) QueryValue {