From 17458fd61018757cdcba8b12126a6ab10064c6d0 Mon Sep 17 00:00:00 2001 From: Wang Yunxiao Date: Wed, 11 Dec 2024 18:24:40 +0800 Subject: [PATCH] =?UTF-8?q?es=20query=20string=20=E6=96=B0=E5=A2=9E=20Fiel?= =?UTF-8?q?ds=20=E6=96=B9=E6=B3=95=E4=BB=A5=E6=94=AF=E6=8C=81=E5=AF=B9?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E5=AD=97=E6=AE=B5=E8=BF=9B=E8=A1=8C=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/es/search_queries_query_string.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/es/search_queries_query_string.go b/pkg/es/search_queries_query_string.go index af328bc..6150e0f 100644 --- a/pkg/es/search_queries_query_string.go +++ b/pkg/es/search_queries_query_string.go @@ -66,6 +66,12 @@ func (q *QueryStringQuery) Field(field string) *QueryStringQuery { return q } +// Field adds a field to run the query string against. +func (q *QueryStringQuery) Fields(fields ...string) *QueryStringQuery { + q.fields = append(q.fields, fields...) + return q +} + // Type sets how multiple fields should be combined to build textual part queries, // e.g. "best_fields". func (q *QueryStringQuery) Type(typ string) *QueryStringQuery {