Elasticsearch indexer support for searching issues with any assignee

This commit is contained in:
Andreas Svanberg 2025-02-23 21:48:22 +01:00
parent f350f1d852
commit f7faab1ac4
No known key found for this signature in database
GPG Key ID: 729B051CFFD42F92

View File

@ -209,7 +209,11 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) (
query.Must(elastic.NewTermQuery("poster_id", options.PosterID.Value()))
}
if options.AssigneeID.Has() {
if options.AnyAssigneeOnly {
q := elastic.NewRangeQuery("assignee_id")
q.Gte(1)
query.Must(q)
} else if options.AssigneeID.Has() {
query.Must(elastic.NewTermQuery("assignee_id", options.AssigneeID.Value()))
}