• Parameters

    • query: SearchQuery

      Query object.

    • Optionaloptions: Options

      Options object.

    Returns Promise<{ query: SearchQuery; response: SearchResult }>

    Promise of search response.

    import { search } from "@nosto/autocomplete"

    search({
    query: "shoes",
    products: {
    fields: ["name", "price"],
    facets: ["brand", "category"],
    size: 10,
    from: 0,
    }
    }).then((state) => {
    console.log(state.response)
    })