feat:Capitalize the priority field of IndexOption so that other systems can access this field from outside the package. (#7342)

This commit is contained in:
nowindexman
2025-01-12 18:16:48 +08:00
committed by GitHub
parent f482f25c71
commit 4ef3af10ed

View File

@ -23,7 +23,7 @@ type IndexOption struct {
Sort string // DESC, ASC
Collate string
Length int
priority int
Priority int
}
// ParseIndexes parse schema indexes
@ -64,7 +64,7 @@ func (schema *Schema) ParseIndexes() []*Index {
idx.Fields = append(idx.Fields, index.Fields...)
sort.Slice(idx.Fields, func(i, j int) bool {
return idx.Fields[i].priority < idx.Fields[j].priority
return idx.Fields[i].Priority < idx.Fields[j].Priority
})
}
}
@ -155,7 +155,7 @@ func parseFieldIndexes(field *Field) (indexes []Index, err error) {
Sort: settings["SORT"],
Collate: settings["COLLATE"],
Length: length,
priority: priority,
Priority: priority,
}},
})
}