@elena - glad you found the workaround.
On your next question
What is the best way to ensure that only one artist or gallery is returned and yet returning all their paintings in the search?
Without knowing exactly how you’ve setup your indices, I’ll work with Algolia best practices.
You described having paintings, galleries, and artists. In Algolia, we recommend having one index per type of record so, in this case, you might have three indices
Furthermore, in Algolia there is no concept of relationships similar to a database (e.g., an Algolia gallery record cannot
have_many artists). To mimic this relationship you have to make a flat object that holds the relationship. For example, a
gallery record might have
artist_ids (which refer to an
// example gallery record
"name": "My Downtown Gallery",
// example artist record
"name": "Vincent van Gogh",
// example painting record
"name": "Starry Night",
From here, I am just guessing how your search could work:
- User enters query for “Van Gogh”
- Search the
- On receipt of the results, collect
painting_ids of the Van Gogh object
- Trigger a subsequent query on the
This requires using concepts like filters so that you can search on objectIDs and then display the results, like this:
filters: 'objectID:1 AND ...'
If this does not seem helpful, please feel free to give us more detail of your index and data configuration and we can give more general guidance. Hope this helps!