Algolia Search without the UI

371 Views Asked by At

Is there a way to query Algolia with vanilla javascript, and get the results without a UI associated with it? For example, using Instantsearch, it requires widgets with containers, but I just want a function that gets the results, and from there, manipulated it as I need. Can this be done with Instantsearch? Autocomplete? or something else? Thanks

1

There are 1 best solutions below

0
On

I was planning on potentially search 2 Algolia client where 1 uses Autocomplete and include results from another client, but I figure out my question. I can just use the searchClient library.

  const searchClient = algoliasearch('Application', 'ApiKey');
  search_client = searchClient.initIndex('Index');
  const requestOptions = {}
  search_client.search('query string', requestOptions)
  .then(({ hits }) => {
    console.log(hits)
  });