feat(search): add locale and facet support#557
Open
wsierakowski wants to merge 3 commits into
Open
Conversation
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description / Motivation
Adds two new optional capabilities to the Search package backed by the Sitecore Search runtime service:
Locale support — a
localefield onSearchParameters(e.g.'en','fr-FR'). Required for multi-locale index configurations; omit for single-locale indexes.Facet support — a
facetfield onSearchParametersandfacetsonSearchResponse, plus six new public types:FacetRequest,FacetField,FacetFilter,FacetFilterOperator,FacetValue,FacetResult. Supports:all: true— return counts for every facet enabled in the index configurationfields— filter results by specific facet values (string/boolean:eq; numeric/datetime:eq,gt,lt,ge,le)Both fields are optional and only sent to the backend when provided (
omitemptysemantics). Both hooksuseSearchanduseInfiniteSearchin@sitecore-content-sdk/reactare updated accordingly.Testing Details
Added 5 unit tests to
packages/search/src/search-service.test.ts:localewhen provided, omits it when not providedfacetwhen provided, mapsdata.facet→response.facets, omits facet when not providedAPI surface files regenerated via
npm run api-extractorin bothpackages/searchandpackages/react.Types of changes