Accessing analytics data to build autocomplete/suggestion features

Hi Again :slight_smile:

I would like to build an index containing popular queries. These are to be used as search suggestions/autocomplete. For that purpose I would like to access all queries for a given index. So questions are:

  1. are there a database storing all queries individually? If so is there an API ?
  2. Is there an API for the analytics data?

Another way around this is simply to store all queries in my own database but that would be stupid if Algolia store all queries already:-)

Best

Hi Jmad,

To access the popular queries, you can do so with the Analytics REST API (Get Popular Searches).

Then, to be able to use them as suggestions, you will need a dedicated index.

There’s an open source project we created called query-suggestions to help you with that. It will analyze your indices and generate query suggestions.

You need to know that for now the project doesn’t respect semantic version yet, and that you’ll need to configure and host the script yourself.

Does this help?

Hi Marie

Thanks. I just could not find the API. I need to improve my google skills :slight_smile:

My other question was whether Algolia stores all queries, and if so whether I can access the database? Analytics only provide accumulated data. I would like to get date/time on the queries etc.

Best

Jens

Hi Jmad,

Unfortunately, we do not store those queries. Customers can only access the aggregated data via the Analytics tool (depending on the plan).

Let us know if you have any other questions.

Dear Marie

Thank you so much :slight_smile: