github Sitecore/content-sdk @sitecore-content-sdk/search@0.5.0

3 hours ago

Minor Changes

  • Add More Like This (MLT) query support to SearchService and React search hooks (b0823f3)

    • New public SearchQuery type models the /v1/search query payload (keyphrase, seedItemId, seedItemUrl)
    • SearchParameters now accepts optional mutually exclusive seedItemId and seedItemUrl fields for MLT widget queries
    • SearchService.search() validates that only one of keyphrase, seedItemId, or seedItemUrl is provided
    • Seed fields are sent only to /v1/search; /v1/search/suggest continues to accept keyphrase only
    • MLT responses map to the existing results / total / facets shape
    • useSearch and useInfiniteSearch accept seedItemId and seedItemUrl
  • Add typeahead suggest support to SearchService (b0823f3)

    • New SearchService.suggest() method calling POST {edgeUrl}/v1/search/suggest
    • Accepts searchIndexId, required non-empty keyphrase, and optional locale
    • Returns wire-shaped querySuggestions and previewResults
    • New public types: SuggestParameters, SuggestResponse, QuerySuggestionItem

Don't miss a new content-sdk release

NewReleases is sending notifications on new releases.