How to stop ElasticSearch from doing type casting?

(Anjith Kumar Paila) #1

I've a field,let's say f1,with type "String" in an index. Now, if I send integer data into field f1, ES is converting the value to String - normally this is the accepted behavior. But in our case we need to prevent this from happening. I'm wondering if there is any seetting which disabled implicit type conversion.

(David Pilato) #2

Unsure about what you want to achieve but a single field can not be at the same time a String or a number.

(Anjith Kumar Paila) #3

Agreed that ES 2.0 doesn't supprt 2 fields with a same name and different types. These are my scenarios:

  1. indexed field f1 with int type: later sent field f1 with string - threw exception, which is expected.
  2. indexed field f1 with string type: later sent field f1 with int- no exception, casted int to string, which we want to avoid.

(David Pilato) #4

I don't think we have such option so you should do that on client side.

(system) #5