fix(indexer): fix assignee filters in issue search (#38021)

fix(indexer): fix assignee filters in issue search (#38021)

Issue search filtering still relied on the legacy single-assignee field,
so searches such as "Assigned to you" could miss issues when a keyword
query was used.

Index all issue assignee IDs and add an explicit no_assignee field so
specific, any-assignee, and no-assignee filters work consistently across
Bleve, Elasticsearch, and Meilisearch.

Fixes #36299.
This commit is contained in:
puni9869
2026-06-22 07:45:24 +02:00
committed by GitHub
parent 7684221ed4
commit a4781dde89
7 changed files with 133 additions and 40 deletions
+7 -1
View File
@@ -87,6 +87,11 @@ func getIssueIndexerData(ctx context.Context, issueID int64) (*internal.IndexerD
return nil, false, err
}
assigneeIDs := make([]int64, 0, len(issue.Assignees))
for _, a := range issue.Assignees {
assigneeIDs = append(assigneeIDs, a.ID)
}
projectIDs := make([]int64, 0, len(issue.Projects))
for _, project := range issue.Projects {
projectIDs = append(projectIDs, project.ID)
@@ -112,7 +117,8 @@ func getIssueIndexerData(ctx context.Context, issueID int64) (*internal.IndexerD
ProjectIDs: projectIDs,
NoProject: len(projectIDs) == 0,
PosterID: issue.PosterID,
AssigneeID: issue.AssigneeID,
AssigneeIDs: assigneeIDs,
NoAssignee: len(assigneeIDs) == 0,
MentionIDs: mentionIDs,
ReviewedIDs: reviewedIDs,
ReviewRequestedIDs: reviewRequestedIDs,