damienbod / ElasticsearchCRUD

Elasticsearch .NET netstandard API
http://damienbod.com/2014/09/22/elasticsearch-crud-net-provider/
176 stars 49 forks source link

Case sensitive property name configuration #132

Open jnus opened 9 years ago

jnus commented 9 years ago

Changed default mapping of property names to case sensitive. Can be configured in ElasticsearchSerializerConfiguration ctor to enable lower case stategy on all property names. Implementation is as non-invasive as possible with the use of an extension method.

Example: configure lower case strategy

            return new ElasticsearchContext(
                                "http://localhost:9200/",
                                new ElasticsearchSerializerConfiguration(
                                                        CreateMappingResolver(date),
                                                        saveChildObjectsAsWellAsParent:true,
                                                        processChildDocumentsAsSeparateChildIndex:false,
                                                        userDefinedRouting:false,
                                                        mapToLowerCase:true)
                );

Example: configure case sensitive strategy (default)

            return new ElasticsearchContext(
                                "http://localhost:9200/",
                                new ElasticsearchSerializerConfiguration(
                                                        CreateMappingResolver(date))
                );
damienbod commented 9 years ago

Hi Jasper, I am testing the pull branch and have noticed that the branch has a build problem and also that the Integration tests do not run because Elasticsearch indices have to be lowercase.

Greetings Damien