Skip to content
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(facets): when * is present, only send that parameter #874

Merged
merged 8 commits into from Oct 8, 2021

Conversation

@Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Oct 6, 2021

When * is present in facets, we don't need to request the individual facet values of each facet that's declared, as * will already request it.

We keep only * if it is present. If no * is present, the facets stay as-is.

see: #391

Alternatively to this PR, similar logic could be part of the algoliasearch client cache, but that has as downside that it requires an update to the search client, also custom implementations and older clients

@Haroenv Haroenv requested review from , tkrugg (assigned from algolia/frontend-experiences-web) and francoischalifour (assigned from algolia/frontend-experiences-web) and removed request for Oct 6, 2021
@Haroenv
Copy link
Contributor Author

@Haroenv Haroenv commented Oct 6, 2021

Upon reflection, I realised that the behaviour with - isn't needed, that's for attributesToRetrieve, not facets

src/requestBuilder.js Outdated Show resolved Hide resolved
@Haroenv Haroenv requested a review from tkrugg Oct 7, 2021
Haroenv added 4 commits Oct 7, 2021
When * is present in facets, we don't need to request the individual facet values of each facet that's declared, as * will already request it.

With a new parameter "expandWildcardFacets", we filter out all facets that aren't * itself or -something. The new parameter doesn't add "*" automatically, it still

To decide:
- is "-something" worth caring about?
- when * isn't present, should no facets be requested or the default ones?
- is this the right location, maybe the client cache should have similar logic instead?

see: #391
@Haroenv Haroenv force-pushed the feat/wildcard-facets branch from caf3814 to 2fcd00b Oct 7, 2021
src/requestBuilder.js Outdated Show resolved Hide resolved
@Haroenv Haroenv changed the title feat(facets): add expandWildcardFacets parameter to process * in facets feat(facets): when * is present, only send that parameter Oct 7, 2021
src/requestBuilder.js Outdated Show resolved Hide resolved
@Haroenv Haroenv requested a review from francoischalifour Oct 7, 2021
test/spec/requestBuilder.js Outdated Show resolved Hide resolved
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
@Haroenv Haroenv merged commit fc183ec into develop Oct 8, 2021
5 checks passed
@Haroenv Haroenv deleted the feat/wildcard-facets branch Oct 8, 2021
Haroenv added a commit that referenced this issue Oct 8, 2021
 * ci(circle): update node image (#875) 3648463
 * feat(facets): when * is present, only send that parameter (#874) fc183ec
Haroenv added a commit to algolia/instantsearch.js that referenced this issue Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants