As initially raised in
HSEARCH-2227 - elasticsearch.ProjectionConstants exposes Lucene constructs New : we know accept both String constants for the Elasticsearch backend and the "regular" Lucene backend, but we can't say if the user is using the right constants as they are just strings to us. It would be interesting to find a way to distinguish the usage, either with typesafety to provide compile-time validation or at least a way to validate these at runtime. We also need to keep in mind that any stored indexed field is also a valid target for projection, and the most likely use case is to mix the identifiers from either set of constants and the field names: would be great to be able to validate projection of field names too. |