-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugins): allow multi-index categoryAttribute in query suggestions #981
Open
andreyvolokitin
wants to merge
6
commits into
algolia:next
Choose a base branch
from
andreyvolokitin:feat/allow-multi-index-category
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+178
−12
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1ff377c
feat(plugins): allow multi-index categoryAttribute in query suggestions
andreyvolokitin a8f9813
refactor(plugin): use nested arrays for multiple paths
andreyvolokitin 467a4de
feat(plugins): accumulate all categories
andreyvolokitin 1b00aea
docs(plugins): add comment comma
andreyvolokitin 2cb5a0a
Merge branch 'next' into feat/allow-multi-index-category
andreyvolokitin 3ee4469
Merge branch 'next' into feat/allow-multi-index-category
andreyvolokitin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/autocomplete-plugin-query-suggestions/src/types/QuerySuggestionsHit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain why only one should be kept?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When indexes gets split by some uniform "property", like data origin, each index will contain same attribute (i.e.
data_origin
), and the value will be different for each index (data_origin="Store"
ordata_origin="Blog"
), and same for all records across the index. By this logic,attrVal
should only contain 1 record, and if it's not the case — I thought it would "wrong" and took "precautions"But thinking about it now — the
categoryAttribute
logic/intention is to provide a facet used for accumulating available "categories" (facet values) which produce hits per each "category". This might mean there's no reason which will forbid to pass multiple non-related facets/attributes, for any indexes — plugin will just accumulate all the things, sorted bycount
. It is all available "categories" after all, so it shouldn't cause anything unusualIf the user wants to use the logic described in a 1st paragraph — they can use a uniform facet value across the index and get their single element inside
attrVal
. If something else is required — all the categories will be accumulated by provided pathsIf this seems like a proper solution I'll keep all the elements (I'm not very familiar with all algolia peculiarities so can't judge, also this gets back to multi-attribute discussion — now it seems like it should be actually useful quite often).
One thing is that if there're multiple indexes separated in described manner, and additionally some facet is used which can have different values across all indexes — how the actual searching will be done? This is multiple indexes needing to be filtered by facet and all hits accumulated in a single widget — but this is, as far as I understood, actually impossible to do I think? So could such attribute only be useful if applied for a single index? And could this be useful in a such "multi-index" scenario? It seems that for a single index it definitely could be useful
In short: I don't have enough algolia experience to decide on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think it will be best to keep all the items — it will be just a generic way of accumulating categories, and the user will decide what should be done with it