Can I make Elasticsearch strictly parse string fields (reject numbers)?

(Dave) #1

If I have a field whose mapping is of type string, and I index a document where that field is a number, Elasticsearch just stringifies that number and stores it. I don't want this behavior. I want Elasticsearch to reject documents with numbers in fields of type string. Is this possible?

(Mark Walkom) #2

No because a string is alphanumeric.
If you want to do that you have to do it at index time in your code.

(system) #3