Christoph Kiehl wrote:
Hm, I don't feel comfortable extending from a soon to be deprecated
class, which contains 95% of the functionality, to implement new
features.
If we create a new query handler class and deprecate SearchIndex then we should
probably extract a common base class for SearchIndex and the new handler.
Extending from SearchIndex is in fact nasty.
As far as I can see all that needs to be modified to support
the changes suggested by Ard is LuceneQueryBuilder and NodeIndexer. I
would rather pass a flag to those to classes or extract the old and the
new functionality to two classes that extend the same interface. This
interface could then be used by the two classes and an appropriate
instance could be injected by SearchIndex (strategy pattern).
It seems like we have now three options:
1) New QueryHandler class
2) Introduce parameter in configuration
3) Auto-detect in SearchIndex
I prefer 1) because it makes it explicit. I have reservations regarding 3)
because it introduces some magic. I don't like 2) because we probably cannot
come up with a sensible name ;)
regards
marcel