optimize method

optimize

Minimizes the number of index segments by merging them, improving search performance.

Optimization merges the index segments of each shard, reducing their count and physically removing data of deleted documents. This is especially useful after many indexing operations that add new segments.

def optimize(self, options):
    ...
Parameter Type Description
options OptimizeOptions The optimize options (OptimizeOptions).

Example

from groupdocs.search.options import OptimizeOptions

# `node` is the master node of a configured and started search network
indexer = node.indexer

# Merge the index segments of each shard
indexer.optimize(OptimizeOptions())

Aliases

These names call optimize too, limited to the overloads listed.

Alias Accepts
optimize_optimize_options optimize_optimize_options(options)

See Also