opensearch-project / opensearch-project/OpenSearch

Get list of all available analyzers. Request for a new API?

Open
#5,481 30 comments 5 reactions 1 assignee View on GitHub

@lukas-vlcek is already working on this.

Since Mar 7, 2023.

distributed framework enhancement Search:Relevance v2.16.0
Dominant language
Java
Stars
13.7k
Forks
3k
Avg merge
2d 23h
Merged PRs (30d)
108

Description

Is your feature request related to a problem? Please describe.

I am missing an option to get list of all available analyzers.
There is already analyze API documentation and it mentions "built-in" analyzers. But for normal user there is no way how to learn what are all the options. And even for people who are familiar with the code the list is a subject to updates/changes.
One option would be to document the list in the documentation page. But I think I would prefer if the cluster itself can give a list of its analyzers (and also tokenizers, charfilters, normalizers).

  • There are built-in analyzers at the cluster level (in fact the list is kept at the node level, see below)
  • There are also ad-hoc/custom analyzers at individual index level (but visibility of these should be subject of RBA rules?)

Describe the solution you'd like

As far as I understand list of all built-in analyzers is materialized once AnalysisModule.setupAnalyzers(plugins) is called.
I think it would be useful to extend one of the _nodes/ APIs and give it option to return list of all built-in analyzers (and its componenets: tokenizers, ... etc). (It needs to be API at the "nodes"-level because AnalysisRegistry is kept per node and I think a list of built-in analyzers can differ on each node depending on installed plugins.)

As for the list of analyzers defined at the index level I am not sure at this point. Maybe later...

Describe alternatives you've considered

Alternative is to go to the documentation (which does not have this list) or go to the code (which is not an option for many people).

Additional context
n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.