KleeGroup / kinetix

Simple .Net Starter Kit
Apache License 2.0
4 stars 7 forks source link

[Search] Cannot use properly custom types #24

Open c3dr0x opened 6 years ago

c3dr0x commented 6 years ago

Issue

I want to use the GeoPoint capabilites of ES. If I give a column on my document the type GeoLocation from Nest. It is not mapped to the geopoint automatically because of the way the ElasticMappingFactory works. It mapped to a myPoint.latitute & myPoint.longitude columns.

Temp Solution

I had to import the ElasticMappingFactory in my project & tweak it by adding the following code the existing cases:

                case SearchFieldCategory.GeoPoint:
                    return selector.GeoPoint(x => x
                        .Name(fieldName)
                        .Store(false));

Final solution

Even if adding that case in kinetix.search would be great. I'd want a way to be able to custom the way fields are mapped within my project. ex: I'd want to use complex columns for some advanced cases.

Like what we did for the Domain add a ElasticCustomMappingFactory that would act as an extension for some custom cases.