Skip to content
Snippets Groups Projects
Commit 7342f205 authored by Francé Wilke's avatar Francé Wilke
Browse files

Api logs wildcard search

parent c52ea579
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......@@ -57,6 +58,7 @@ 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"`
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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment