advancedSyntax

Type: boolean
Engine default: false
Parameter syntax
'advancedSyntax' => true|false
Parameter syntax
advancedSyntax: true|false
Parameter syntax
advancedSyntax: true|false
Parameter syntax
'advancedSyntax': True|False
Parameter syntax
"advancedSyntax": true
Parameter syntax
new JSONObject()
  .set("advancedSyntax", true|false)
Parameter syntax
dynamic settings = new JObject();
settings.advancedSyntax = true|false;
Parameter syntax
.setAdvancedSyntax(true|false)
Parameter syntax
"advancedSyntax": true|false
Parameter syntax
advancedSyntax = Some(true)

Can be used in these methods:
search, setSettings, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, set_settings, browse, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, setSettings, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, set_settings, browse, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, setSettings, browse, searchForFacetValues searchAsync, setSettingsAsync, browseAsync, searchForFacetValues Search, SetSettings, Browse, SearchForFacetValues, GenerateSecuredApiKey, AddApiKey, UpdateApiKey Search, setSettings, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey Search, SetSettings, Browse, SearchForFacetValues, GenerateSecuredAPIKey, AddAPIKey, UpdateAPIKey search, changeSettings, browse index, search into facet values, generateSecuredApiKey, add key, update key

About this parameter

Enables the advanced query syntax.

This advanced syntax brings two additional features:

  • Phrase query: a specific sequence of terms that must be matched next to one another. A phrase query needs to be surrounded by double quotes ("). For example, "search engine" will only match records having search next to engine.

    Note: Typo tolerance is disabled inside the phrase (i.e. within the quotes).

  • Prohibit operator: excludes records that contain a specific term. This term has to be prefixed by a minus (-). For example, search -engine will only match records containing search but not engine.

Examples

Enable advanced syntax by default

<?php
$index->setSettings([
  'advancedSyntax' => true
]);
index.set_settings({
  advancedSyntax: true
})
index.setSettings({
  advancedSyntax: true
});
index.set_settings({
  'advancedSyntax': True
})
index.setSettings([
  "advancedSyntax": true
])
index.setSettings(
  new JSONObject()
    .put("advancedSyntax", true)
);
dynamic settings = new JObject();
settings.advancedSyntax = true;

index.SetSettings(settings);
index.setSettings(
  new IndexSettings().setAdvancedSyntax(true)
);
res, err := index.SetSettings(algoliasearch.Map{
  "advancedSyntax": true,
})
client.execute {
  changeSettings of "myIndex" `with` IndexSettings(
    advancedSyntax = Some(true)
  )
}
<?php
$results = $index->search('query', [
  'advancedSyntax' => true
]);
results = index.search('query', {
  advancedSyntax: true
})
index.search({
  query: 'query',
  advancedSyntax: true
}).then(res => {
  // console.log(res);
});
results = index.search('query', {
  'advancedSyntax': True
})
let query = Query(query: "query")
query.advancedSyntax = true

index.search(query, completionHandler: { (res, error) in
  print(res)
})
index.search(
  new Query("query")
    .setAdvancedSyntax(false)
);
index.search(
  new Query("query")
    .EnableAdvancedSyntax(true)
);
index.search(
  new Query("query")
    .setAdvancedSyntax(true)
);
res, err := index.Search("query", algoliasearch.Map{
  "advancedSyntax": true,
})
client.execute {
  search into "myIndex" query Query(
    query = Some("query"),
    advancedSyntax = Some(true)
  )
}
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala