Filter unused and duplicate entries from elasticsearch index configuration.
More...
Filter unused and duplicate entries from elasticsearch index configuration.
◆ deduplicateAnalysisConfig()
CirrusSearch\Maintenance\AnalysisFilter::deduplicateAnalysisConfig |
( |
array | $analysis | ) |
|
Remove duplicate analysis chain elements and report aliases that need to be applied to mapping configuration.
This is necessary for indices such as wikibase that eagerly create analysis chains for many languages. Quite a few languages result in the same elements and this deduplication can remove a large fraction of the configuration.
- Parameters
-
array | $analysis | The index.analysis field of elasticsearch index settings |
- Returns
- string[] map from old analyzer name to new analyzer name.
◆ filterAnalysis()
CirrusSearch\Maintenance\AnalysisFilter::filterAnalysis |
( |
array | $analysis, |
|
|
array | $mappings, |
|
|
| $deduplicate = false, |
|
|
array | $protected = [] ) |
Shrink the size of elasticsearch index configuration.
Removes analysis chain elements that are defined but never referenced from the mappings. Optionally deduplicates elements of the analysis chain.
- Parameters
-
array | $analysis | Elasticsearch index analysis configuration |
array | $mappings | Elasticsearch index mapping configuration |
bool | $deduplicate | When true deduplicate the analysis chain |
string[] | $protected | list of named analyzers that should not be removed. |
- Returns
- array [$settings, $mappings]
◆ filterUnusedAnalysisChain()
CirrusSearch\Maintenance\AnalysisFilter::filterUnusedAnalysisChain |
( |
| $analysis, |
|
|
Set | $usedAnalyzers ) |
- Parameters
-
array | $analysis | The index.analysis field of elasticsearch index settings |
Set | $usedAnalyzers | Set of analyzers to keep configurations for |
- Returns
- array The $analysis array filtered to only pieces needed for $usedAnalyzers
◆ findUsedAnalyzersInMappings()
CirrusSearch\Maintenance\AnalysisFilter::findUsedAnalyzersInMappings |
( |
array | $mappings | ) |
|
- Parameters
-
array[] | $mappings | Elasticsearch mapping configuration |
- Returns
- Set The set of analyzer names referenced in $mappings
◆ pushAnalyzerAliasesIntoMappings()
CirrusSearch\Maintenance\AnalysisFilter::pushAnalyzerAliasesIntoMappings |
( |
array | $mappings, |
|
|
| $aliases ) |
- Parameters
-
array[] | $mappings | Elasticsearch index mapping configuration |
string[] | $aliases | Mapping from old name to new name for analyzers |
- Returns
- array Updated index mapping configuration
The documentation for this class was generated from the following file:
- includes/Maintenance/AnalysisFilter.php