| A lot of what we do in the IndexSchemaCollector/IndexSchemaElement is very similar in the Elasticsearch backend and the Lucene backend. This includes:
- Handling the nesting context
- Delegating to a "node builder"
- As of
HSEARCH-3141 Pull Request Sent , validating field names
We should probably follow an approach similar to what we did for the Search Predicate DSL: define a common implementation in the engine (IndexSchemaCollector, IndexSchemaElement in particular) which delegates to lower-level SPIs implemented in the backend ("node builders"), and expect backends that define extensions to delegate to the common implementation (extend some DelegatingIndexSchemaElement class defined in the engine as SPI, similarly to DelegatingSearchPredicateContainerContextImpl). |