Skip to content

Commit

Permalink
search sd_hash by prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Dec 14, 2021
1 parent eadd5d7 commit 274598a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 274598a

Please sign in to comment.