The Elasticsearch documents state the following:
The default logical name allows one to configure an analyzer that will be used both for indexing and for searching APIs. The default_index logical name can be used to configure a default analyzer that will be used just when indexing, and the default_search can be used to configure a default analyzer that will be used just when searching.
In other words, it is possible to configure a default analyzer used when indexing, and another used when searching.
This question and its answer helped me to create a node with a default analyzer for indexing, which (simplified) can programmatically be done like this:
public Node node() {
ImmutableSettings.Builder elasticsearchSettings = ImmutableSettings.settingsBuilder()
.put("index.analysis.analyzer.default.type", "keyword");
return NodeBuilder.nodeBuilder()
.settings(elasticsearchSettings.build())
.node();
}
What would be the equivalent way of specifying the default analyzer to be used when searching?