Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Deserializing a custom analyzer without type specified fails #1032

Closed
Xtansia opened this issue Jun 19, 2024 · 0 comments · Fixed by #1033
Closed

[BUG] Deserializing a custom analyzer without type specified fails #1032

Xtansia opened this issue Jun 19, 2024 · 0 comments · Fixed by #1033
Labels
bug Something isn't working

Comments

@Xtansia
Copy link
Collaborator

Xtansia commented Jun 19, 2024

What is the bug?

It is possible to manually create a custom analyzer without the type property explicitly specified. Attempting to deserialize this with the client such as when retrieving the index with client.indices.get() it will fail due to no type property. The server's logic is that type must be specified unless tokenizer is specified in which case type: "custom" is assumed.

How can one reproduce the bug?

  1. Create an index with a custom analyzer in Dev Tools:
PUT /custom-analyzer-index
{
        "mappings": {
            "properties": {
                "text_chunk": {
                    "type": "text",
                    "analyzer": "custom_kuromoji_analyzer"
                }
            }
        },
        "settings": {
            "index": {
                "analysis": {
                    "analyzer": {
                        "custom_kuromoji_analyzer": {
                            "filter": [
                                "kuromoji_baseform",
                                "ja_stop"
                            ],
                            "char_filter": [
                                "icu_normalizer"
                            ],
                            "tokenizer": "kuromoji_tokenizer"
                        }
                    }
                }
            }
        }
}
  1. Execute client.indices().get(b -> b.index("custom-analyzer-index"))

What is the expected behavior?

Analyzer to successfully deserialize as a CustomAnalyzer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant