Creating a filtered replica

Hey everyone!

I didn’t found what I want in the documentation. I probably searched the wrong way.

What I have :
There are two search inputs based on the same data. Their datasets are a subset of a master index. The first search uses several indice attributes. The second one searches only on one attribute.

What I want :
I want to be able to synchronise all the data easily without showing how the data is shaped on the client.

What I’d like to do :
I’d like to create/use a kind of “preconfigured” indice replica. Which means having a master indice containing all the data. Then, from this master indice, I’d like to create a replica filtered by an attribute. The goal would be to call an indice without setting searchParameters on the client.

Maybe I’m thinking this thing the wrong way. I’d take any other solution which will help me to get what I want.

Does it make sense? Do you have any recommendation?

Thanks.

Hi Bruno,

To be honest I don’t really understand why would rather set another indexName instead of a searchParameters.
In your problem, do you have any restriction like you don’t want the user to be able to acces other data because they should be secured? If so, I believe you should use Secured API Keys.

Replicas are always kept in sync with the master index, there is no way to use it as a sub index.

The first search uses several indice attributes. The second one searches only on one attribute.

To deal with that, you can restrict the searchable attributes at query time.

Let me know if that answer some of your problems

Hi Julien,

Thanks for your answer, it looks good. I wasn’t aware of the Secured API Keys.
But for other reasons, I has to use two different indices.

Thanks again.

1 Like