@nosto/search-js
    Preparing search index...

    Function search

    • Performs a search operation using the provided query and options.

      Type Parameters

      Parameters

      • query: SearchQuery

        The search query to be executed.

      • options: SearchOptions<HD> = {}

        An object containing optional parameters for the search.

      Returns Promise<DecoratedResult<HD>>

      A promise that resolves to the search result.

      import { search } from '@nosto/search-js'
      import { priceDecorator } from '@nosto/search-js/currencies'

      // Basic search
      const results = await search({ query: 'shoes' })

      // Search with decorators
      const decoratedResults = await search(
      { query: 'shoes' },
      { hitDecorators: [priceDecorator()] }
      )
      import { search } from '@nosto/search-js'

      // Search with filters
      const results = await search({
      query: 'shoes',
      filters: {
      color: ['red', 'blue']
      }
      })