querySuggestionsPlugin multi-index categoryAttribute
#978
Replies: 1 comment
-
I looked at the code and it appears that it might be as hard as traversing all available paths and accumulating total results, so not very unusual, except for a special syntax: Am I missing something here? I will be glad to make a PR if this thing seems useful/viable |
Beta Was this translation helpful? Give feedback.
-
Currently it's not possible to use
categoryAttribute
inquerySuggestionsPlugin
to target multiple indexes. But suggestions index actually can be derived from multiple indexes, and traversing acategoryAttribute
path results in error when the found suggestion index isn't the index which was put intocategoryAttribute
I'd actually like
categoryAttribute
to work with multiple indexes, but not sure how it could be done, probably with some special syntax for the first path segment it might be possible (likeindex_1|index_2
), but it quickly starts to look not so sane (i,e. trying to traverse each index while the path is resolved). Also the case when suggestion is found for both indexes, meaning the hits object should contain all matched indexes, and all successful path traversals should be included in a final result — it quickly goes out of control...Also it seems like the category which spans multiple indexes is a bit strange, but maybe it is not?
But the categorised suggestions indeed can be helpful, even if each "category" resides in it's own index (like in my case, because I need a way to query first N relevant results from each "category", or index in my case, which is not easy/possible with a single index using regular categories/facets).
Is it viable to make
categoryAttribute
work with multiple indexes?Beta Was this translation helpful? Give feedback.
All reactions