chaitra d
chaitra d

Reputation: 65

Adding Prefix when creating an Index using Jredisearch

I use Jredisearch(com.redislabs:jredisearch:2.0.0) to store data in an Index. I want to add a prefix while creating the Index. I am able to add prefix using the below Redisearch command FT.CREATE MyIndex ON HASH PREFIX 1 doc: SCHEMA name TEXT

But not able to find options for the same when writing in Java. I use the following code in Java, client.createIndex(schema, Client.IndexOptions.defaultOptions());

Could anyone suggest how do we add Prefix when using Jredisearch?

Upvotes: 2

Views: 455

Answers (1)

sazzad
sazzad

Reputation: 6267

IndexDefinition class has a setPrefixes(...) method which serves your purpose.

Note: You may have to create IndexDefinition using new IndexDefinition().

Upvotes: 2

Related Questions