Using one refinementList for multiple objects

We are using algoliasearch-django to populate our indices and React InstantSearch to search. Right now, we have two models in Django, each of which has their own index. Both ModelA and ModelB have the same attributes for faceting. We’re struggling right now to create a refinementList that will apply to searches on both indices.

One thought we had was to, in Django, create one index that has both ModelA and ModelB in it, but this is proving tricky because the two models have no common ancestor.

We thought we should be able to use indexId somehow in the React code but the InstantSearch component has no ‘indexId’ attribute.

Any thoughts on the best way forward would be much appreciated.

Hi @rgraber, I may be misunderstanding your question, but there is an objectID on each record in the index. Would this work for you?

To clarify: ModelA and ModelB are separate Django models in our backend. The ‘modelA’ index contains all the objects in ModelA, the ‘modelB’ index contains all objects in ModelB. ModelA and ModelB are very different classes, but do have a few of the same attributes. The problem we’re trying to solve is making a refinementList that filters both indices.

This is similar to Instantsearch.js with multi index search and sharing searchbox and facets (refinementlists) , but we’d like to do this in React