I have an ES entity:
@Document(indexName = "company")
public class CompanyEntity {
@MultiField(
mainField = @Field(type = Text, name = "alias_name"),
otherFields = {@InnerField(suffix = "keyword", type = Keyword, nullValue = "NULL")})
@Nullable
private String aliasName;
...
}
If I create a CompanyEntity object and do not supply an aliasName, my expectation is that spring Data Elasticsearch would persist null values for entity properties that are Nullable
. But this does not seem to be the case, even if I supply a value for the nullValue
in the InnerField
annotation.
I'm sure I have misconfigured an annotation or something, but I would really like to use Elasticsearch's null_value
parameter as detailed here. But first I need to understand how to get SDE to persist null values.
Thank you for your time!
As null values can not be indexed or searched they are normally not stored by Spring Data Elasticsearch thus reducing the size of the indexed document.
The possibility to store null values nevertheless was added with this issue and will be contained in version 4.1.RC1 which should be released tomorrow.
Edit: 4.1.0.RC1 is released now