Postby code reader » Mon Dec 21, 2009 11:20 pm
some thoughts about search:
currently phpBB supports a pluggable search engine.
however, there is a separation between the search front-end (aka UI) and the search backend, which really hurts the plugin "paradigm".
for instance, if a certain backend wants to support additional features, it can't, at least not without also becoming a MOD.
OTOH, if a search backend wants a waiver from a supporting some capability which is published by the UI it can't, at least not without it being a bona fides bug.
if a certain backend wants to use a different syntax for the search input string, it can't (again, without becoming a MOD. the reason is that the syntax is explained to the user outside the scope of the plugin)
and, i believe sorting is handled outside of the plugin, so even if the plugin supplies the results in a certain order (say, relevance), this gets wiped by the envelope (i may be wrong here: long time since i visited this code, and i don't have the time now to check).
one way to go about it is to create a "feature-list" of supported search features, and allow the backend to declare which features are supported.
this way, a single, very feature-rich UI can serve them all, while suppressing display of any feature not supported by the currently running backend.
this will not solve the "please allow me a private syntax" part, but would still be a significant improvement over today's state.
another option is to allow every backend to define its own UI: so there will be a default UI that would work for any backend that does not wish to bring in its own UI, but would still *allow* the backend to define its UI.
the last approach can be taken to the extreme and not even bother to create this default UI, so *each and every* backend will be required to roll its own.
long long time ago i created a mysql-fulltext thingy for phpbb2, and i found that if i do not want to support the things which were difficult (e.g. allow searches on "message body only" or "body+title", which i found mostly useless but was not trivial with mysql fulltext), and at the same time wanted to support features like phrase search which were not supported in the vanilla package, i had to change the UI.
btw: not only because of capabilities, but also because i needed to change the syntax of the search string, so i needed to change the explanations.
if it was up to me, i would completely eliminate the "native phpbb" search altogether. i would build a thin layer that links to google using the site:yoursite searchphrase syntax, and *maybe* use google's API to present the results internally.
(this approach has a major disadvantage that it can't index forums with restricted visibility, and it has the advantage that it builds on top of all of google's intelligence).
at the same time i would make sure that the door is wide open for add-on writers to supply all kinds of search.
peace.