Skip to content

Commit

Permalink
Merge pull request #1275 from tigrisdata/main
Browse files Browse the repository at this point in the history
Release Beta
  • Loading branch information
himank authored Jun 13, 2023
2 parents becc26a + 908416e commit 4ae41ad
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion server/metadata/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,18 @@ func (tenant *Tenant) DeleteSearchIndex(ctx context.Context, tx transaction.Tx,

index, ok := project.search.GetIndex(indexName)
if !ok {
return NewSearchIndexNotFoundErr(indexName)
schV, err := tenant.searchSchemaStore.GetLatest(ctx, tx, tenant.namespace.Id(), project.id, indexName)
if err != nil {
return err
}

searchFactory, err := schema.NewFactoryBuilder(false).BuildSearch(indexName, schV.Schema)
if err != nil {
return err
}

searchStoreIndexName := tenant.Encoder.EncodeSearchTableName(tenant.namespace.Id(), project.Id(), indexName)
index = schema.NewSearchIndex(schV.Version, searchStoreIndexName, searchFactory, nil)
}

return tenant.deleteSearchIndex(ctx, tx, project, index)
Expand Down

0 comments on commit 4ae41ad

Please sign in to comment.