Default Value for IP data type


I have this object with this mapping,
"IpAddress": {
"type": "ip",
"index": "true",
"null_value": "NULL"
I tried to persist a document with this value: Ex: ipAddress=""
It successfully persisted but I have this error on logs,

Stack Trace : 
org.elasticsearch.client.ResponseException: PUT http://localhost:9200/infor_auditlogentry_os: HTTP/1.1 400 Bad Request
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping [objectentry]: 'NULL' is not an IP string literal."}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [objectentry]: 'NULL' is not an IP string literal.","caused_by":{"type":"illegal_argument_exception","reason":"'NULL' is not an IP string literal."}},"status":400}
at org.elasticsearch.client.RestClient$1.completed(

I'm wondering why am I getting this error when I have successfully persisted my data.
And also what is your suggested default value for IP datatypes?
Is it "" or ""

Thank you

Just remove this:

"null_value": "NULL"

From your mapping.

Then when you index a document just omit the field IpAddress.

My 2 cents

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