Indexer
Leave feedback
On this page
Inheritance: java.lang.Object
public abstract class Indexer
Represents a service that manages the distribution of indexed documents across shards of the search network.
| Constructor | Description |
|---|---|
| Indexer() |
| Method | Description |
|---|---|
| add(Document[] documents, String[] passwords, IndexingOptions options) | Performs indexing operation. |
| add(ExtractedData[] data, IndexingOptions options) | Performs indexing operation. |
| delete(String[] documentKeys, DeleteOptions options) | Deletes indexed documents. |
| optimize(OptimizeOptions options) | Minimizes the number of index segments by merging them one with another. |
| synchronize(SynchronizeOptions options) | Synchronizes the list of indexed documents with those on shards. |
| changeAttributes(AttributeChangeBatch batch, ChangeAttributesOptions options) | Applies the specified batch of attribute changes to indexed documents without reindexing. |
| getAttributes(String documentKey) | Gets all the attributes associated with the specified indexed document. |
| getDictionary(DictionaryType dictionaryType, int shardIndex) | Gets a dictionary from the specified shard. |
| getAlphabet(int shardIndex) | Gets the alphabet dictionary. |
| getAliasDictionary(int shardIndex) | Gets the alias dictionary. |
| getCharacterReplacementDictionary(int shardIndex) | Gets the character replacement dictionary. |
| getSynonymDictionary(int shardIndex) | Gets the synonym dictionary. |
| getHomophoneDictionary(int shardIndex) | Gets the homophone dictionary. |
| getSpellingCorrector(int shardIndex) | Gets the spelling corrector dictionary. |
| getStopWordDictionary(int shardIndex) | Gets the stop word dictionary. |
| getPasswordDictionary(int shardIndex) | Gets the password dictionary. |
| setDictionary(DictionaryBase dictionary, int shardIndex) | Sets a dictionary in the specified shard. |
| setDictionary(DictionaryBase dictionary) | Sets a dictionary in all shards. |
| deleteAllData() | Deletes all indexed data from all shards of the search network. |
public Indexer()
public abstract void add(Document[] documents, String[] passwords, IndexingOptions options)
Performs indexing operation. Indexing only from stream and structure is supported.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| documents | Document[] | The documents from file system, stream, or structure. |
| passwords | java.lang.String[] | The document passwords. |
| options | IndexingOptions | The add options. |
public abstract void add(ExtractedData[] data, IndexingOptions options)
Performs indexing operation. Adds the extracted data to the search network.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| data | ExtractedData[] | The extracted data. |
| options | IndexingOptions | The indexing options. |
public abstract void delete(String[] documentKeys, DeleteOptions options)
Deletes indexed documents.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| documentKeys | java.lang.String[] | The keys of documents added from streams or structures. |
| options | DeleteOptions | The delete options. |
public abstract void optimize(OptimizeOptions options)
Minimizes the number of index segments by merging them one with another. This operation improves search performance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| options | OptimizeOptions | The optimize options. |
public abstract void synchronize(SynchronizeOptions options)
Synchronizes the list of indexed documents with those on shards. This operation fixes issues with indexing and deletion of documents that resulted from communication problems with the search network nodes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| options | SynchronizeOptions | The synchronize options. |
public abstract void changeAttributes(AttributeChangeBatch batch, ChangeAttributesOptions options)
Applies the specified batch of attribute changes to indexed documents without reindexing.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| batch | AttributeChangeBatch | The attribute change batch. |
| options | ChangeAttributesOptions | The change attributes options. |
public abstract String[] getAttributes(String documentKey)
Gets all the attributes associated with the specified indexed document.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| documentKey | java.lang.String | The document key. |
Returns: java.lang.String[] - The attributes associated with the specified indexed document.
public abstract DictionaryBase getDictionary(DictionaryType dictionaryType, int shardIndex)
Gets a dictionary from the specified shard.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| dictionaryType | DictionaryType | The dictionary type. |
| shardIndex | int | The shard index. |
Returns: DictionaryBase - The dictionary.
public abstract Alphabet getAlphabet(int shardIndex)
Gets the alphabet dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: Alphabet - The dictionary.
public abstract AliasDictionary getAliasDictionary(int shardIndex)
Gets the alias dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: AliasDictionary - The dictionary.
public abstract CharacterReplacementDictionary getCharacterReplacementDictionary(int shardIndex)
Gets the character replacement dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: CharacterReplacementDictionary - The dictionary.
public abstract SynonymDictionary getSynonymDictionary(int shardIndex)
Gets the synonym dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: SynonymDictionary - The dictionary.
public abstract HomophoneDictionary getHomophoneDictionary(int shardIndex)
Gets the homophone dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: HomophoneDictionary - The dictionary.
public abstract SpellingCorrector getSpellingCorrector(int shardIndex)
Gets the spelling corrector dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: SpellingCorrector - The dictionary.
public abstract StopWordDictionary getStopWordDictionary(int shardIndex)
Gets the stop word dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: StopWordDictionary - The dictionary.
public abstract PasswordDictionary getPasswordDictionary(int shardIndex)
Gets the password dictionary.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| shardIndex | int | The shard index. |
Returns: PasswordDictionary - The dictionary.
public abstract void setDictionary(DictionaryBase dictionary, int shardIndex)
Sets a dictionary in the specified shard.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| dictionary | DictionaryBase | The dictionary. |
| shardIndex | int | The shard index. |
public abstract void setDictionary(DictionaryBase dictionary)
Sets a dictionary in all shards.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| dictionary | DictionaryBase | The dictionary. |
public abstract void deleteAllData()
Deletes all indexed data from all shards of the search network.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.