Error deserializing co.elastic.clients.elasticsearch._types.analysis.CharFilterDefinition: Unknown 'type' value: 'stconvert'
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by tracing CharFilterDefinition, CharFilterDefinitionVariant, and CharFilterDefinition.Kind, then compare their handling with HtmlStripCharFilter. Determine whether the client has an established path for plugin-provided char-filter types; done should be a documented, tested way to serialize the stconvert definition or a clear limitation if custom types cannot be supported.
Written by the indexing model from the issue text.
Description
Description
I am trying to create an index using a java client, and I have installed the stconvert plugin in the elasticsearch cluster (a plugin that provides replacement for both traditional and simplified Chinese), and I am getting this error during the index creation process.
My code implementation:
Reader stconvertJson = new StringReader(
"{\"type\":\"stconvert\",\"delimiter\":\"#\",\"keep_both\":false,\"convert_type\":\"t2s\"}");
Map<String, CharFilter> charFilterMap = new HashMap<>();
charFilterMap.put("tsconvert", new CharFilter.Builder()
.definition(new CharFilterDefinition.Builder().withJson(stconvertJson).build()).build());
CreateIndexRequest c = new CreateIndexRequest.Builder()
.index(index)
.aliases(aliases, a -> a
.isWriteIndex(true))
.settings(s -> s
.analysis(a -> a
.charFilter(charFilterMap) //this
.filter(filterMap)
.tokenizer(tokenizerMap)
.analyzer(analyzerMap))
.numberOfShards("1")
.numberOfReplicas("1"))
.mappings(typeMapping)
.build();
createIndexResponse = elasticClient.indices().create(c);
found that this is not feasible, and also in order to be able to pass serialization, I also tried to implement CharFilterDefinitionVariant to do it, similar to HtmlStripCharFilter, but eventually failed because CharFilterDefinition.Kind could not satisfy me.
So I was wondering if elasticsearch has additional plugins to build index in the java client, how should I go about doing that or inherit the implementation code?
- Dominant language
- Java
- Stars
- 524
- Forks
- 300
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastic/elasticsearch-java
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
elastic/elasticsearch-java#1339 · 3 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
elastic/elasticsearch-java#1212 · 8 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
elastic/elasticsearch-java#1165 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
elastic/elasticsearch-java#1083 · 2 comments ·
-
Area: Generator Category: Enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
elastic/elasticsearch-java#1034 · 2 comments ·
All issues in elastic/elasticsearch-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100