I've been trying to cleanup TitleKey a bit (hackathon project).

One issue was the deprecation of PrefixSearchBackend, the associated hook
and the class TitlePrefixSearch in 1.41. Apparently this was already meant
to be deprecated since 1.27, but never really properly carried out.

However the Core's searchengine itself still uses all this, and the only
proper way to override it, is by reimplementing the completionSearchBackend
method of your own searchengine backend, which means that you have to
provide all other search functionality for via that alternative backend as
well. This is also how CirrusSearch does this.

However, for TitleKey, we essentially want to bolt this on top of an
existing backend and that's not a simple job any longer. I'm now ending up
with this:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TitleKey/+/1036312
Three new subclasses for the three core searchengines that the system admin
installing TitleKey has to choose from. Not really convenient.

Issues I see with the deprecation:
- There is no alternative hook to modify prefix search results.
- Does it even make sense to have the class TitlePrefixSearch be deprecated
(without replacement), if it is implementing the same logic for all core
searchengine backend right now via the abstract SearchEngine class ?
- Another nice option might be to have a TitlePrefixSearch to be a service,
similar to TitleMatcher ? That would make it easier to replace the code
- Should core replace TitlePrefixSearch with a search based on a near match
(fuzzy match) with TitleMatcher service perhaps ?

Additionally:
- There is no core concept of nearmatch title matching in core search
engines (cirrus search can do this, and it does so via the
completionsearch, but that seems a bit of a hack).
- There is also a deprecated StringPrefixSearch also deprecated since 1.27,
but only officially since 1.41, which is used exclusively by
Extension:MassEditRegex and that seems to be in the same boat.
- There are more questions for the future and implementation of titlekey
extension itself, but i think those are better left for another time.

So my question is: Where do we want to take prefix/completionSearch in
core. Do we want to address this and if so what are your suggestions ?

DJ
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

Reply via email to