icu_collation_keyword property not supported
See original GitHub issueNEST/Elasticsearch.Net version: v6.0.0-rc1
Elasticsearch version: 6.1.1
Description of the problem including expected versus actual behavior:
We need to use the icu_collation_keyword property type for our mappings. In the previous version of NEST, we used a custom implementation of IProperty
(code below). However, since upgrading the package to v6.0.0-rc1, the properties marked with the JsonProperty
don’t get serialized anymore.
Expected behavior: either an already existing implementation of the icu_collation_keyword
or the proper serialization of properties marked with JsonProperty
.
Steps to reproduce:
- Use the below implementation of a property
- Field is mapped as “type”: “icu_collation_keyword”, but all other properties (language and so on) are missing
public class IcuCollationKeywordProperty : IProperty
{
public IcuCollationKeywordProperty(string name, string language)
{
this.Name = new PropertyName(name);
this.Type = "icu_collation_keyword";
this.Language = language;
this.Variant = "@collation=standard";
this.Strength = "primary";
this.Numeric = true;
}
public IcuCollationKeywordProperty(string language)
: this(null, language)
{
}
public string Type { get; set; }
public PropertyName Name { get; set; }
public IDictionary<string, object> LocalMetadata { get; set; }
[JsonProperty("language")]
public string Language { get; set; }
[JsonProperty("strength")]
public string Strength { get; set; }
[JsonProperty("variant")]
public string Variant { get; set; }
[JsonProperty("numeric")]
public bool Numeric { get; set; }
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
no handler for type [icu_collation_keyword] declared on field
I'm trying to create index with the mapping. Using URL : localhost:9200/test3?pretty Method : PUT and with body { "mappings": { "properties": { ......
Read more >ICU collation keyword field | Elasticsearch Plugins and ...
Collations are used for sorting documents in a language-specific word order. The icu_collation_keyword field type is available to all indices and will ...
Read more >Configuration Properties - Hadoop HDFS Repository Plugin
If your cluster has an HDFS repository configured, then all nodes in the cluster must be able to reach HDFS when starting. If...
Read more >Liferay Portal 7.4 GA27 and Liferay Commerce 4.0 GA27 ...
By setting a product info key property it will be possible to update all dependencies ... Cart import file to support Requested delivery...
Read more >[Solved]-FOSCommentBundle Sorting-symfony
How to enable sorting with sonata_type_model? Symfony2 - EntityRepository - Sorting rows - is this a good and save approach? Elastich search -...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If anyone can find this useful, here’s a complete IProperty implementation I prepared based on the current documentation 6.4: https://www.elastic.co/guide/en/elasticsearch/plugins/6.4/analysis-icu-collation-keyword-field.html. I’m not an expert, though.
@cguedel thanks for raising this, I will add explicit support and documentation for how to do this in
6.x
today. Since we have internalizedJson.NET
you are correct that[JsonProperty]
is no longer supported even when referencingNest.JsonNetSerializer
since this serializer only takes affect on your types where we expect them e.g_source
field values
query values
etcetera. NEST’s internal types our always handled by our internal serializer.Being able to extend classes or interfaces with additional properties is the whole reason we added the overhead of interfaces to begin with so we need to support this OOTB.
[Nest.Object]
is a side affect of the mapping, and should have no place on extending NEST types, unless you are indexing NEST types as source. We’ll ship with an explicit new Attribute for this with6.0
GA.