Reputation: 182
So I've been working with AlgoliaSearch (Python and JS). I currently have multiple indices set up (let's say "dogs", "cats", "birds"). As it stands currently, when I type a query into the input field, it seems like each index section in the rsults applies a ranking value to the query results that come up for each index (e.g., "dogs" has 3 high ranking results, "cats" has 2 high ranking results, and "birds" has 4 high ranking results. It doesn't seem like Algolia compares the ranking for each of the results ACROSS the indexes. So for example, in "dogs", the rankings are based on how they compare to the other results inside of the "dogs" index, but are not compared to the "cats" and "birds" results.
Is there a way to do this in the settings? I've been trying to figure this out, but I'm unable to find a definitive answer.
Upvotes: 5
Views: 1622
Reputation: 465
Having different type of data sitting into different indices, is very useful because it enables the users to retrieve the most relevant and popular results of each index. The index "dogs" can have his own ranking strategy and return dogs sorted by "lastUpdate date". Maybe the index "cat" could have the records sorted by "number of followers each cat have". And the "bird" one use a 3rd ranking strategy. Having such behavior actually enable you to build user-experiences similar to the one described in Algolia's "multi-categories auto-completion" tutorial
That being said, I'd say that if the value you use to describe the popularity of each record (the one used for customRanking) is different for each type of data, having data in different indices is probably the best way to do. But if you want to use something homogenous across all indices, and have 'dogs', 'cats' and 'birds' results merged all together (and compared to each other), then you should probably put all your dogs/cats/birds records within a same and uniq 'animals' index.
Upvotes: 4