Implement Create/Drop Index/Metadata index in GO (#13791)

### What problem does this PR solve?

Implement Create/Drop Index/Metadata index in GO

New API handling in GO:
POST/kb/index 
DELETE /kb/index
POST /tenant/doc_meta_index
DELETE /tenant/doc_meta_index

CREATE INDEX FOR DATASET 'dataset_name' VECTOR_SIZE 1024;
DROP INDEX FOR DATASET 'dataset_name';
CREATE INDEX DOC_META;
DROP INDEX DOC_META;

### Type of change

- [x] Refactoring
This commit is contained in:
qinling0210
2026-03-26 11:54:10 +08:00
committed by GitHub
parent d19ca71b43
commit ebf36950e4
20 changed files with 1165 additions and 30 deletions

View File

@@ -42,7 +42,7 @@ type DocEngine interface {
Search(ctx context.Context, req interface{}) (interface{}, error)
// Index operations
CreateIndex(ctx context.Context, indexName string, mapping interface{}) error
CreateIndex(ctx context.Context, indexName, datasetID string, vectorSize int, parserID string) error
DeleteIndex(ctx context.Context, indexName string) error
IndexExists(ctx context.Context, indexName string) (bool, error)
@@ -51,8 +51,11 @@ type DocEngine interface {
BulkIndex(ctx context.Context, indexName string, docs []interface{}) (interface{}, error)
DeleteDocument(ctx context.Context, indexName, docID string) error
// Chunk operations
GetChunk(ctx context.Context, indexName, chunkID string, kbIDs []string) (interface{}, error)
// Chunk operations
GetChunk(ctx context.Context, indexName, chunkID string, kbIDs []string) (interface{}, error)
// Doc metadata index operations (per-tenant)
CreateDocMetaIndex(ctx context.Context, indexName string) error
// Health check
Ping(ctx context.Context) error