Analyzer
picturesafe-search supports the definition of custom analyzers for the Elasticsearch text analysis feature.
Default analyzer
In the default configuration, a picturesafe-search specific built-in analyzer is activated by default:
This analyzer can be deactivated in the elasticsearch.properties
:
elasticsearch.index.default_analyzer.enabled=false
If you disable the picturesafe-search default analyzer, Elasticsearch uses its built-in Standard Analyzer.
Create custom analyzer
When the picturesafe-search or Elasticsearch built-in analyzers do not fulfill your needs, you can create custom analyzers.
If the default configuration is used, the DefaultIndexConfiguration
can easily be derived, as the following example shows:
Above CustomIndexConfiguration
has to be imported and can then be used for a field configuration:
Via the StandardFieldConfiguration
builder, a defined custom analyzer can be assigned to the field for which the analyzer is to be used:
This field configuration leads to the following Elasticsearch mapping:
A custom analyzer sample can be found here.