Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRediSearch create index on hash prefix #2

Open
rakhimzhanov opened this issue Feb 9, 2021 · 4 comments
Open

NRediSearch create index on hash prefix #2

rakhimzhanov opened this issue Feb 9, 2021 · 4 comments

Comments

@rakhimzhanov
Copy link

Hi team,

Is there any way to create an index with prefix in the library NRediSearch like below?
FT.CREATE idx:movie ON hash PREFIX 1 "movie:" SCHEMA title TEXT SORTABLE release_year

Example was used from this source

Regards,
L

@SCT-Shimazaki
Copy link

I am having this exact question. I store objects of multiple classes so to say, and I need this "prefix" thing for Redisearch to work as expected.

@mgravell
Copy link
Collaborator

mgravell commented Mar 15, 2021 via email

@SCT-Shimazaki
Copy link

SCT-Shimazaki commented Mar 15, 2021

I read this thread and also found it out, thank you!

StackExchange/StackExchange.Redis#1544

But how can I specify prefixes when adding documents?

A object of the IndexDefinition type can only go to ConfiguredIndexOptions, which will then be supplied only to CreateIndex() or its async counterpart. Not to AddDocument()

When you add a document you also need to specify the prefix so I think we need the ConfiguredIndexOptions as one of the parameters here too

@mysterio21
Copy link

But how can I specify prefixes when adding documents?

If you are using AddDocumentAsync for example you can specify the docId parameter with the prefix, for example: movie:11002

@NickCraver NickCraver transferred this issue from StackExchange/StackExchange.Redis Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants