🎉 Try the public beta of the new docs site at algolia.com/doc-beta! 🎉
API Reference / API Parameters / mode
Type: string
Engine default:
Parameter syntax

Can be used in these methods:

About this parameter

Activate or deactivate NeuralSearch for a participating index.

After activating NeuralSearch, you can set the search mode for the index.

If mode is neuralSearch, NeuralSearch is active for the current index. If you set getRankingInfo to true, the _rankingInfo property in the API response contains these additional fields:

  • keywordScore: How well the record matched in keyword search
  • semanticScore: How well the record matched in semantic search
  • neuralScore: A combination of both scores

If mode is keywordSearch, results are returned from keyword search only.

Options

keywordSearch

Use only keyword-based search.

neuralSearch

Use NeuralSearch, which combines keyword and AI-based vector search.

Examples

Turn on NeuralSearch

Set the mode to neuralSearch to turn on NeuralSearch for an index.

1
$index->setSettings(['mode' => 'neuralSearch']);

Turn off NeuralSearch

Set the mode to keywordSearch to turn off NeuralSearch for an index.

1
$index->setSettings(['mode' => 'keywordSearch']);
Did you find this page helpful?