From 715cfebfb2ad8d6e5bc2a64ee4fcc25bacc7b22f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?France=CC=81=20Wilke?= <francewilke@gmail.com>
Date: Mon, 13 Dec 2021 22:03:42 +0200
Subject: [PATCH] Fix QueryTerm

---
 search/opensearch_types.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/search/opensearch_types.go b/search/opensearch_types.go
index d2ae209..6ddbfac 100644
--- a/search/opensearch_types.go
+++ b/search/opensearch_types.go
@@ -43,7 +43,7 @@ type SearchRequestBody struct {
 type Query struct {
 	//one of:
 	Match       *QueryNameValue  `json:"match,omitempty" doc:"<field>:<value>"`
-	Term        *QueryNameValue  `json:"term,omitempty"`
+	Term        *QueryTerm       `json:"term,omitempty"`
 	Range       *QueryRange      `json:"range,omitempty"`
 	MultiMatch  *QueryMultiMatch `json:"multi_match,omitempty"`
 	Bool        *QueryBool       `json:"bool,omitempty"`
@@ -51,6 +51,8 @@ type Query struct {
 	Wildcard    *QueryNameValue  `json:"wildcard,omitempty"` //https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html
 }
 
+type QueryTerm map[string]string //<oper>:<value>
+
 type QueryMultiMatch struct {
 	Query  string   `json:"query" doc:"Full value match search in selected fields"`
 	Fields []string `json:"fields,omitempty" doc:"List of fields"`
-- 
GitLab