From 274598ac8d31ec0d8b137de4ee34a5db89aa1cd8 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Tue, 14 Dec 2021 18:33:06 -0300 Subject: [PATCH] search sd_hash by prefix --- server/search.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/search.go b/server/search.go index f357f92e..0f00b1c3 100644 --- a/server/search.go +++ b/server/search.go @@ -595,6 +595,10 @@ func (s *Server) setupEsQuery( q = q.Must(elastic.NewTermsQuery("stream_type", searchVals...)) } + if in.SdHash != "" { + q.Must(elastic.NewPrefixQuery("sd_hash.keyword", in.SdHash)) + } + if in.ClaimId != nil { searchVals := StrArrToInterface(in.ClaimId.Value) if len(in.ClaimId.Value) == 1 && len(in.ClaimId.Value[0]) < 20 {