Add support for a default analyzer configured at the analysis configurer level

Description

Elasticsearch supports it, and while I really believe no one should rely on something like this, I must admit it does make life easier for demos and new users.

It also will make the migration helper less awkward: currently we have to assume an analyzer named "default" is defined by the user, issuing warnings in the hope they'll catch it before the unavoidable bootstrap error...

Implementation-wise, I was thinking of:

  • Adding a default value of "" for @FullTextField.analyzer.

  • Exposing a defaultAnalyzer() method on StringIndexFieldTypeOptionsStep.

  • Exposing a .defaultAnalyzer(String) method in *AnalysisConfigurationContext to set the default analyzer.

  • In the Elasticsearch backend, the default analyzer, unless specified through configuration, would be whatever is defined in the ES cluster. I.e. we would just use the string "default" to reference the analyzer and let Elasticsearch resolve that to whatever is specified in the configuration. If a default analyzer is specified, we'll just set the index setting "index.analysis.analyzer.default.type" to the name of that analyzer.

  • In the Lucene backend, the default analyzer, unless specified through configuration, would be the StandardAnalyzer.

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Fix versions

Priority

Major
Configure