Skip to content

Commit b33d5e0

Browse files
authored
meta: add the needed fields of IndexInfo for fts
2 parents 9e44059 + 30cf4a9 commit b33d5e0

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

pkg/meta/model/index.go

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,40 @@ type VectorIndexInfo struct {
5858
DistanceMetric DistanceMetric `json:"distance_metric"`
5959
}
6060

61+
type ParserType string
62+
63+
const (
64+
ParserTypeAuto ParserType = "auto"
65+
ParserTypeStandard ParserType = "standard"
66+
// ...
67+
)
68+
69+
// FulltextIndexInfo is the information of fulltext index of a column.
70+
type FulltextIndexInfo struct {
71+
ParserType ParserType `json:"parser_type"`
72+
// not provide any parameters for now
73+
IndexParameters map[string]string `json:"index_parameters"`
74+
}
75+
6176
// IndexInfo provides meta data describing a DB index.
6277
// It corresponds to the statement `CREATE INDEX Name ON Table (Column);`
6378
// See https://dev.mysql.com/doc/refman/5.7/en/create-index.html
6479
type IndexInfo struct {
65-
ID int64 `json:"id"`
66-
Name ast.CIStr `json:"idx_name"` // Index name.
67-
Table ast.CIStr `json:"tbl_name"` // Table name.
68-
Columns []*IndexColumn `json:"idx_cols"` // Index columns.
69-
State SchemaState `json:"state"`
70-
BackfillState BackfillState `json:"backfill_state"`
71-
Comment string `json:"comment"` // Comment
72-
Tp ast.IndexType `json:"index_type"` // Index type: Btree, Hash, Rtree or HNSW
73-
Unique bool `json:"is_unique"` // Whether the index is unique.
74-
Primary bool `json:"is_primary"` // Whether the index is primary key.
75-
Invisible bool `json:"is_invisible"` // Whether the index is invisible.
76-
Global bool `json:"is_global"` // Whether the index is global.
77-
MVIndex bool `json:"mv_index"` // Whether the index is multivalued index.
78-
VectorInfo *VectorIndexInfo `json:"vector_index"` // VectorInfo is the vector index information.
80+
ID int64 `json:"id"`
81+
Name ast.CIStr `json:"idx_name"` // Index name.
82+
Table ast.CIStr `json:"tbl_name"` // Table name.
83+
Columns []*IndexColumn `json:"idx_cols"` // Index columns.
84+
State SchemaState `json:"state"`
85+
BackfillState BackfillState `json:"backfill_state"`
86+
Comment string `json:"comment"` // Comment
87+
Tp ast.IndexType `json:"index_type"` // Index type: Btree, Hash, Rtree or HNSW
88+
Unique bool `json:"is_unique"` // Whether the index is unique.
89+
Primary bool `json:"is_primary"` // Whether the index is primary key.
90+
Invisible bool `json:"is_invisible"` // Whether the index is invisible.
91+
Global bool `json:"is_global"` // Whether the index is global.
92+
MVIndex bool `json:"mv_index"` // Whether the index is multivalued index.
93+
VectorInfo *VectorIndexInfo `json:"vector_index"` // VectorInfo is the vector index information.
94+
FulltextInfo *FulltextIndexInfo `json:"fulltext_index"` // FulltextInfo is the fulltext index information.
7995
}
8096

8197
// Hash64 implement HashEquals interface.

0 commit comments

Comments
 (0)