I want to create user index like below using spring-data-elasticsearch-2.1.0. annotation. I am not able to find any annotation to add "null_value": "NULL". This is required because our sorting order is failing.
"user": {
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"displayName": {
"type": "string",
"analyzer": "word_analyzer",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"null_value": "NULL"
}
}
}
}
}
Domain class
private String firstName;
private String lastName;
@MultiField(
mainField = @Field(type = FieldType.String, analyzer = "word_analyzer"),
otherFields = {
@InnerField(suffix = "raw", type = FieldType.String, index = FieldIndex.not_analyzed)
}
)
private String displayName;
How to add "null_value": "NULL" through spring-data-elasticsearch annotation in InnerField? I do not want to creating index mapping externally.