Export Synonyms

Required API Key: any key with the settings ACL
Method signature
$index->initSynonymIterator()
Method signature
index.export_synonyms
Method signature
index.exportSynonyms()
Method signature
index.iter_synonyms()
Method signature
This method is not available in mobile API clients.

Synonyms need to be configured via
the Algolia Dashboard or with one of our backend API clients.

Method signature
This method is not available in mobile API clients.

Synonyms need to be configured via
the Algolia Dashboard or with one of our backend API clients.

Method signature
new SynonymsIterator(indexName).toList()
Method signature
new SynonymsIterable(index)

Method signature
algoliasearch.NewSynonymIterator(indexName)
Method signature
AlgoliaSyncHelper(client).exportSynonyms(indexName)

About this method

Retrieve an index’s complete list of synonyms.

The list includes all synonyms - whether created on the dashboard or pushed by the API.

The method returns an iterator.

Examples

<?php
$browser = $index->initSynonymIterator();

foreach ($browser as $key => $synonym) {
    var_dump($synonym);
}
# Get synonyms by batch
synonyms = index.export_synonyms
# With a block
index.export_synonyms { |synonym| puts synonym }
index.exportSynonyms(100, function(synonym) {
  console.log(synonym);
});
# Print all synonyms in an index.
for synonym in index.iter_synonyms():
    print(synonym)
var synonymsIterator = new SynonymsIterator(_index);
var synonymsFetched = synonymsIterator.ToList();
// Only on Sync
Index<Contact> index = client.initIndex("myIndex", Contact.class);
for(AbstractSynonym s = new SynonymsIterable(index)) {
  System.out.println(s);
}
it := algoliasearch.NewSynonymIterator(index)
for {
    synonym, err = it.Next()

    if err == algoliasearch.NoMoreSynonymsErr {
        break
    } else if err != nil {
        fmt.Printf("Error: %s\n", err)
    }

    // Do something with `synonym`
}
val helper = AlgoliaSyncHelper(client)
helper.exportSynonyms("myIndex").map(println)

Parameters

indexName
type: string
only needed in go, scala, c#

Index name.

Response

Returns a synonym iterator.

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