Open Ozitiho opened 7 years ago
@Ozitiho - as you found out ... creating custom analyzers (if they do not already exist) is not handled by the code currently :(
If I, you or some other member of our community submits a PR with tests then we can get the feature merged and released.
Currently there are two other big PRs which I'm waiting to review with their respective contributors. Given that it is quite busy at my day-job ... I'm semi sure that I won't be contributing any new code (on my own) this year.
Good to know! Since I do need this feature, I'll probably make it myself eventually. If I do, I'll make sure to make a PR for it. Thanks for clarifying. :)
I'm using an ElasticSearch solution for search-as-you-type, that requires a custom analyzer. In order for this to work, a custom analyzer/tokenizer have to be set when creating an index. I'm assuming this connector supports that, as the config example an analyzer is made in settings too. However, when I try to do the same, no analyzer is made. So when I try to create the mapping using this custom analyzer, it obviously fails as the analyzer does not exist.
Here's what I got.
datasource.json:
"mappings": [ { "name": "term", "properties": { "term": { "type": "string", "analyzer": "autocomplete", "search_analyzer": "standard" } } } ], "settings": { "analysis": { "filter": { "autocomplete_filter": { "type": "edge_ngram", "min_gram": 1, "max_gram": 20 } }, "analyzer": { "autocomplete": { "type": "custom", "tokenizer": "standard", "filter": [ "lowercase", "autocomplete_filter" ] } } } },
Output:
Naturally, those same settings work fine when I insert them manually. When I do this I push the settings in the body of the POST request for making the index. If I do this, this connector can also make the mapping without issue, giving me a workaround for now. But I'll be damned if I have to create the index manually when this connector can do it automatically.