mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-11 13:46:46 +00:00
Modify indexer json field name
This commit is contained in:
parent
0b78ae4161
commit
1e51590711
@ -83,7 +83,7 @@ func generateIssueIndexMapping() (mapping.IndexMapping, error) {
|
|||||||
docMapping.AddFieldMappingsAt("label_ids", numberFieldMapping)
|
docMapping.AddFieldMappingsAt("label_ids", numberFieldMapping)
|
||||||
docMapping.AddFieldMappingsAt("no_label", boolFieldMapping)
|
docMapping.AddFieldMappingsAt("no_label", boolFieldMapping)
|
||||||
docMapping.AddFieldMappingsAt("milestone_id", numberFieldMapping)
|
docMapping.AddFieldMappingsAt("milestone_id", numberFieldMapping)
|
||||||
docMapping.AddFieldMappingsAt("project_id", numberFieldMapping)
|
docMapping.AddFieldMappingsAt("project_ids", numberFieldMapping)
|
||||||
docMapping.AddFieldMappingsAt("project_board_id", numberFieldMapping)
|
docMapping.AddFieldMappingsAt("project_board_id", numberFieldMapping)
|
||||||
docMapping.AddFieldMappingsAt("poster_id", numberFieldMapping)
|
docMapping.AddFieldMappingsAt("poster_id", numberFieldMapping)
|
||||||
docMapping.AddFieldMappingsAt("assignee_id", numberFieldMapping)
|
docMapping.AddFieldMappingsAt("assignee_id", numberFieldMapping)
|
||||||
|
@ -68,7 +68,7 @@ const (
|
|||||||
"label_ids": { "type": "integer", "index": true },
|
"label_ids": { "type": "integer", "index": true },
|
||||||
"no_label": { "type": "boolean", "index": true },
|
"no_label": { "type": "boolean", "index": true },
|
||||||
"milestone_id": { "type": "integer", "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 },
|
"project_board_id": { "type": "integer", "index": true },
|
||||||
"poster_id": { "type": "integer", "index": true },
|
"poster_id": { "type": "integer", "index": true },
|
||||||
"assignee_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 {
|
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() {
|
if options.ProjectColumnID.Has() {
|
||||||
query.Must(elastic.NewTermQuery("project_board_id", options.ProjectColumnID.Value()))
|
query.Must(elastic.NewTermQuery("project_board_id", options.ProjectColumnID.Value()))
|
||||||
|
@ -30,7 +30,7 @@ type IndexerData struct {
|
|||||||
LabelIDs []int64 `json:"label_ids"`
|
LabelIDs []int64 `json:"label_ids"`
|
||||||
NoLabel bool `json:"no_label"` // True if LabelIDs is empty
|
NoLabel bool `json:"no_label"` // True if LabelIDs is empty
|
||||||
MilestoneID int64 `json:"milestone_id"`
|
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
|
ProjectColumnID int64 `json:"project_board_id"` // the key should be kept as project_board_id to keep compatible
|
||||||
PosterID int64 `json:"poster_id"`
|
PosterID int64 `json:"poster_id"`
|
||||||
AssigneeID int64 `json:"assignee_id"`
|
AssigneeID int64 `json:"assignee_id"`
|
||||||
|
@ -70,7 +70,7 @@ func NewIndexer(url, apiKey, indexerName string) *Indexer {
|
|||||||
"label_ids",
|
"label_ids",
|
||||||
"no_label",
|
"no_label",
|
||||||
"milestone_id",
|
"milestone_id",
|
||||||
"project_id",
|
"project_ids",
|
||||||
"project_board_id",
|
"project_board_id",
|
||||||
"poster_id",
|
"poster_id",
|
||||||
"assignee_id",
|
"assignee_id",
|
||||||
|
Loading…
Reference in New Issue
Block a user