Modify indexer json field name

This commit is contained in:
Tyrone Yeh 2025-07-23 10:13:38 +08:00
parent 0b78ae4161
commit 1e51590711
No known key found for this signature in database
GPG Key ID: AC8B5AA00375E170
4 changed files with 5 additions and 5 deletions

View File

@ -83,7 +83,7 @@ func generateIssueIndexMapping() (mapping.IndexMapping, error) {
docMapping.AddFieldMappingsAt("label_ids", numberFieldMapping)
docMapping.AddFieldMappingsAt("no_label", boolFieldMapping)
docMapping.AddFieldMappingsAt("milestone_id", numberFieldMapping)
docMapping.AddFieldMappingsAt("project_id", numberFieldMapping)
docMapping.AddFieldMappingsAt("project_ids", numberFieldMapping)
docMapping.AddFieldMappingsAt("project_board_id", numberFieldMapping)
docMapping.AddFieldMappingsAt("poster_id", numberFieldMapping)
docMapping.AddFieldMappingsAt("assignee_id", numberFieldMapping)

View File

@ -68,7 +68,7 @@ const (
"label_ids": { "type": "integer", "index": true },
"no_label": { "type": "boolean", "index": true },
"milestone_id": { "type": "integer", "index": true },
"project_id": { "type": "integer", "index": true },
"project_ids": { "type": "integer", "index": true },
"project_board_id": { "type": "integer", "index": true },
"poster_id": { "type": "integer", "index": true },
"assignee_id": { "type": "integer", "index": true },
@ -205,7 +205,7 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) (
}
if len(options.ProjectIDs) > 0 {
query.Must(elastic.NewTermsQuery("project_id", toAnySlice(options.ProjectIDs)...))
query.Must(elastic.NewTermsQuery("project_ids", toAnySlice(options.ProjectIDs)...))
}
if options.ProjectColumnID.Has() {
query.Must(elastic.NewTermQuery("project_board_id", options.ProjectColumnID.Value()))

View File

@ -30,7 +30,7 @@ type IndexerData struct {
LabelIDs []int64 `json:"label_ids"`
NoLabel bool `json:"no_label"` // True if LabelIDs is empty
MilestoneID int64 `json:"milestone_id"`
ProjectIDs []int64 `json:"project_id"`
ProjectIDs []int64 `json:"project_ids"`
ProjectColumnID int64 `json:"project_board_id"` // the key should be kept as project_board_id to keep compatible
PosterID int64 `json:"poster_id"`
AssigneeID int64 `json:"assignee_id"`

View File

@ -70,7 +70,7 @@ func NewIndexer(url, apiKey, indexerName string) *Indexer {
"label_ids",
"no_label",
"milestone_id",
"project_id",
"project_ids",
"project_board_id",
"poster_id",
"assignee_id",