1

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?

1 Answer 1

1

I believe the default analyzers can be defined using:

  • index.analysis.analyzer.default_index.type for indexing
  • index.analysis.analyzer.default_search.type for searching
Sign up to request clarification or add additional context in comments.

2 Comments

Ah, I think I get it. index.analysis.analyzer.default.type actually sets the default analyzer for both indexing and searching, while the above can be used to set different analyzers?
That's my understanding, yes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.