Note: this should already be done in Search 6 as part of HSEARCH-3099: we just need to not restore support for the default null tokens. So let’s mark this as fixed once HSEARCH-3099 is fixed.
Hibernate Search 5 allows to define a field with a null token without specifying the token to use, and to configure the token to use through configuration properties. See
org.hibernate.search.test.query.nullValues.IndexAndQueryNullTest#configure, org.hibernate.search.test.query.nullValues.Value#fallback and org.hibernate.search.test.query.nullValues.IndexAndQueryNullTest#testIndexAndSearchConfiguredDefaultNullToken for an example.
I think we should remove this feature completely in Search 6.
As explained in HSEARCH-1995 , this is not as easy to implement as it used to be, because we now support multiple field types and there's no null token that would work for all of them.
If users need to use a constant, they can reference it directly through the Field.indexNullAs attribute, and they do not need a configuration option.
If users need this option to be configurable through application properties, they can use the programmatic mapping.