Indexer

Inheritance: java.lang.Object

public abstract class Indexer

Represents a service that manages the distribution of indexed documents across shards of the search network.

Constructors

Constructor Description
Indexer()

Methods

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.

Indexer()

public Indexer()

add(Document[] documents, String[] passwords, IndexingOptions options)

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.

add(ExtractedData[] data, IndexingOptions 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.

delete(String[] documentKeys, DeleteOptions 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.

optimize(OptimizeOptions 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.

synchronize(SynchronizeOptions 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.

changeAttributes(AttributeChangeBatch batch, ChangeAttributesOptions 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.

getAttributes(String documentKey)

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.

getDictionary(DictionaryType dictionaryType, int shardIndex)

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.

getAlphabet(int shardIndex)

public abstract Alphabet getAlphabet(int shardIndex)

Gets the alphabet dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: Alphabet - The dictionary.

getAliasDictionary(int shardIndex)

public abstract AliasDictionary getAliasDictionary(int shardIndex)

Gets the alias dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: AliasDictionary - The dictionary.

getCharacterReplacementDictionary(int shardIndex)

public abstract CharacterReplacementDictionary getCharacterReplacementDictionary(int shardIndex)

Gets the character replacement dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: CharacterReplacementDictionary - The dictionary.

getSynonymDictionary(int shardIndex)

public abstract SynonymDictionary getSynonymDictionary(int shardIndex)

Gets the synonym dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: SynonymDictionary - The dictionary.

getHomophoneDictionary(int shardIndex)

public abstract HomophoneDictionary getHomophoneDictionary(int shardIndex)

Gets the homophone dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: HomophoneDictionary - The dictionary.

getSpellingCorrector(int shardIndex)

public abstract SpellingCorrector getSpellingCorrector(int shardIndex)

Gets the spelling corrector dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: SpellingCorrector - The dictionary.

getStopWordDictionary(int shardIndex)

public abstract StopWordDictionary getStopWordDictionary(int shardIndex)

Gets the stop word dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: StopWordDictionary - The dictionary.

getPasswordDictionary(int shardIndex)

public abstract PasswordDictionary getPasswordDictionary(int shardIndex)

Gets the password dictionary.

Parameters:

Parameter Type Description
shardIndex int The shard index.

Returns: PasswordDictionary - The dictionary.

setDictionary(DictionaryBase dictionary, int shardIndex)

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.

setDictionary(DictionaryBase dictionary)

public abstract void setDictionary(DictionaryBase dictionary)

Sets a dictionary in all shards.

Parameters:

Parameter Type Description
dictionary DictionaryBase The dictionary.

deleteAllData()

public abstract void deleteAllData()

Deletes all indexed data from all shards of the search network.