Skip to content

feat(search): add locale and facet support#557

Open
wsierakowski wants to merge 3 commits into
Sitecore:devfrom
wsierakowski:feat/search-locale-facets
Open

feat(search): add locale and facet support#557
wsierakowski wants to merge 3 commits into
Sitecore:devfrom
wsierakowski:feat/search-locale-facets

Conversation

@wsierakowski

Copy link
Copy Markdown

Description / Motivation

Adds two new optional capabilities to the Search package backed by the Sitecore Search runtime service:

Locale support — a locale field on SearchParameters (e.g. 'en', 'fr-FR'). Required for multi-locale index configurations; omit for single-locale indexes.

Facet support — a facet field on SearchParameters and facets on SearchResponse, plus six new public types: FacetRequest, FacetField, FacetFilter, FacetFilterOperator, FacetValue, FacetResult. Supports:

  • all: true — return counts for every facet enabled in the index configuration
  • fields — filter results by specific facet values (string/boolean: eq; numeric/datetime: eq, gt, lt, ge, le)
  • Both combined — filter results while still returning full facet counts

Both fields are optional and only sent to the backend when provided (omitempty semantics). Both hooks useSearch and useInfiniteSearch in @sitecore-content-sdk/react are updated accordingly.

Testing Details

  • Unit Test Added
  • Manual Test/Other

Added 5 unit tests to packages/search/src/search-service.test.ts:

  • locale: sends locale when provided, omits it when not provided
  • facets: sends facet when provided, maps data.facetresponse.facets, omits facet when not provided

API surface files regenerated via npm run api-extractor in both packages/search and packages/react.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4352b4a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant