NeuralSearch combines the precision of keyword search with the deep understanding of natural language and contextual relevance provided by AI-based vector search. On every keystroke, NeuralSearch performs a hybrid keyword and vector search, merges the results, and ranks them based on relevance so that searchers get fast and accurate results that align with their search intent.

Before you begin

NeuralSearch has the following requirements:

Set up NeuralSearch

You can activate NeuralSearch on an index in your Algolia dashboard:

1

Select your Algolia application

Go to the Algolia dashboard and select your Algolia application.

2

Select Search

On the left sidebar, select

Search.

3

Select your index

Select your Algolia index:

4

Configure NeuralSearch

Go to Configure > NeuralSearch and click Configure NeuralSearch.

5

Select source

Select your event source. By default, NeuralSearch uses events from the index you selected to train the language model. If your index has replicas, you can add them as additional event sources. Click Add event sources to add these event source indices.

6

Select NeuralSearch options

If you collected enough events in the last 30 days, you can select one of these options:

  • Select Activate NeuralSearch to start the training and activate NeuralSearch for the current index.
  • Select See NeuralSearch in action to create a replica index where you can test NeuralSearch.

Both options are inactive until you collect enough events.

Building the NeuralSearch index takes time, depending on your index size.

Search with NeuralSearch

Searching with NeuralSearch works the same as before, except with an increased understanding of the query. Now, instead of matching only keywords in the text, the search engine also returns results that match concepts:

Keyword searchNeuralSearch
MatchesKeywordsConcepts and keywords
ResultsExact or similar keyword matchesRelevant results, even if the query doesn’t match keywords
Understanding of user intentLimitedCan anticipate intent based on the search

Set the search mode in the API

After activating NeuralSearch in the dashboard, you can use the mode API parameter to turn NeuralSearch off:

To re-activate NeuralSearch for the current index:

How NeuralSearch ranks results

NeuralSearch results have a neural score composed of a keyword score, a semantic score, or both.

Keyword score

The keyword score represents how well a record matches the query from a keyword search against other keyword-retrieved results. At the base of this score is Algolia’s tie-breaking algorithm. A record has a keyword score if a keyword search finds it.

Semantic score

The semantic score represents how well a record matches the query from a vector search against other vector-retrieved results. The basis of this score is neural hash similarity. A record has a semantic score if a vector search finds it.

Neural score

The neural score combines the keyword score and the semantic score. It measures how relevant the record is compared to the other records in the result set. The neural score answers the question: “Against this query, compared to these other results, how relevant is this result?”