| On a more general note regarding design, what we need to find is are meaningful abstractions. This means, find underlying, generally applying concepts, put these into APIs/SPIs and let specific implementations map these abstractions to specific engines such as Lucene or ES or Solr. An abstraction is not the super-set of of all "things" provided by all the different backends we support. E.g. we shouldn't expose concepts of ES on IndexManager, say closeGsonWriter() either. So, no, leaking a concept such as "IndexWriter" on the level of the abstraction which only makes sense for one implementation is no good design; On the contrary, such leaky abstraction is confusing and makes the contracts only tougher to implement. In contrast, a more abstract concept such as "releaseResources" (making up the example), is something which is generally applicable. It may be a no-op in some implementations, but that's perfectly fine, the point is that it doesn't leak through implementation details on the abstraction evel. |