Reputation: 1137
I'm using Algolia API with PHP and currently I have 4 indices (one per DB table as they recommend).
When submitting a search I'm doing a multipleQueries
query to search all indices but the problem is that in the result set each index is ranked and returns its own facets which then have to be combined somehow before being displayed.
Is there a way to specify a global ranking strategy when searching to avoid doing that manually after getting the results?
Upvotes: 0
Views: 509
Reputation: 1070
Going for the "1 index per DB table" may not the ultimate answer, and depends on your specific use case, and on the UI you intend to provide.
In the case of movies and actors, you can't really expect to provide a unique UI for both: it's unlikely that facets you can apply to a movie can also be applied to an actor. In that case, separate indexes is the way to go.
If you intend to merge the results or use a single set of facet values for all your indexes, then you should probably go for a unique, big, index. Because Algolia is schema-less, you don't even have to have all your records having strictly the same structure.
If you insist on staying on separate indices, unfortunately, there is no way to do so without recoding a significant part of the engine ranking strategy inside your front-end.
Upvotes: 1