Returning error when trying to insert document with non-existent field

For example , I want to insert new document which consist of two strings into myindex/mytype
"name" : "joe",
"city": "ny"

BUT mytype consist only of one string field : "name"

in this case I want the indexing to fail, and that elasticsearch return an error. How do I do that ?
Right now it creates new document :frowning:

Thanls for your help !

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.