Skip to content

how to add new index to old ones #632

Open
@hamidrabedi

Description

So i have these indexes on the first startup:

	if err := r.Repository.CreateIndex(context.Background(), func(schema om.FtCreateSchema) rueidis.Completed {
		return schema.
			FieldName("$.user.owner").As("owner").Tag().
			FieldName("$.user.name").As("name").Tag().
			Build()
	}); err != nil {
		logs.Warning(err)
	}

now I need to add a new index:

	if err := r.Repository.CreateIndex(context.Background(), func(schema om.FtCreateSchema) rueidis.Completed {
		return schema.
			FieldName("$.user.owner").As("owner").Tag().
			FieldName("$.user.name").As("name").Tag().
			FieldName("$.user.id").As("id").Tag().
			Build()
	}); err != nil {
		logs.Warning(err)
	}

But I get an index already exists error. I need my Redis to be persistent and can't flush everything.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions