Hi!
I'd like to describe the refactoring we are doing on SearchEngine/Prefix search. The goal of it is to bring prefix search into SearchEngine API and use the unified API for prefix searches, which will also allow to use new ElasticSearch completion suggester in many places where prefix search is done. Please comment if you see any problem in this or have any suggestions.
The current plan is as follows:
1. SearchEngine gets the following new API functions: public function defaultPrefixSearch( $search ); public function completionSearch( $search ); public function completionSearchWithVariants( $search );
defaultPrefixSearch is for simple prefix searches (namespace lists, special pages, etc.). completionSearch* is for completions that need scoring, fuzzy matching, and so on.
2. There's also internal function: protected function completionSearchBackend( $search )
That is what SearchEngine implementation (like CirrusSearch) will override. SearchEngine base class deals with namespace handling, result ordering, etc.
3. TitlePrefixSearch and StringPrefixSearch will be deprecated (but stay in code almost unchanged for now) and use of SearchEngine APIs is recommended, such as SearchEngine::defaultPrefixSearch() or completionSearch() depending on whether simple or advanced handling is desired.
4. Hooks PrefixSearchBackend and PrefixSearchExtractNamespace will be deprecated, and overriding completionSearchBackend() and normalizeNamespaces() in SearchEngine is recommended instead. For now, these hooks will be supported by base SearchEngine implementation, but not by CirrusSearch.
The task for this is https://phabricator.wikimedia.org/T121430, it also links the patches as they are now (still work in progress).
Speaking as the person who has to parse our requests, what will this look like from the external API's point of view?
On 28 January 2016 at 18:15, Stas Malyshev smalyshev@wikimedia.org wrote:
Hi!
I'd like to describe the refactoring we are doing on SearchEngine/Prefix search. The goal of it is to bring prefix search into SearchEngine API and use the unified API for prefix searches, which will also allow to use new ElasticSearch completion suggester in many places where prefix search is done. Please comment if you see any problem in this or have any suggestions.
The current plan is as follows:
- SearchEngine gets the following new API functions: public function defaultPrefixSearch( $search ); public function completionSearch( $search ); public function completionSearchWithVariants( $search );
defaultPrefixSearch is for simple prefix searches (namespace lists, special pages, etc.). completionSearch* is for completions that need scoring, fuzzy matching, and so on.
- There's also internal function:
protected function completionSearchBackend( $search )
That is what SearchEngine implementation (like CirrusSearch) will override. SearchEngine base class deals with namespace handling, result ordering, etc.
- TitlePrefixSearch and StringPrefixSearch will be deprecated (but stay
in code almost unchanged for now) and use of SearchEngine APIs is recommended, such as SearchEngine::defaultPrefixSearch() or completionSearch() depending on whether simple or advanced handling is desired.
- Hooks PrefixSearchBackend and PrefixSearchExtractNamespace will be
deprecated, and overriding completionSearchBackend() and normalizeNamespaces() in SearchEngine is recommended instead. For now, these hooks will be supported by base SearchEngine implementation, but not by CirrusSearch.
The task for this is https://phabricator.wikimedia.org/T121430, it also links the patches as they are now (still work in progress). -- Stas Malyshev smalyshev@wikimedia.org
discovery mailing list discovery@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/discovery
Can this be put into non-geek? As a user it is not evident what is being achieved, how it is being achieved, or how it is being changed. How advanced users on wiki can use and superuse the functionality expressed..
Regards, Billinghurst
On Fri, Jan 29, 2016 at 10:15 AM, Stas Malyshev smalyshev@wikimedia.org wrote:
Hi!
I'd like to describe the refactoring we are doing on SearchEngine/Prefix search. The goal of it is to bring prefix search into SearchEngine API and use the unified API for prefix searches, which will also allow to use new ElasticSearch completion suggester in many places where prefix search is done. Please comment if you see any problem in this or have any suggestions.
The current plan is as follows:
- SearchEngine gets the following new API functions: public function defaultPrefixSearch( $search ); public function completionSearch( $search ); public function completionSearchWithVariants( $search );
defaultPrefixSearch is for simple prefix searches (namespace lists, special pages, etc.). completionSearch* is for completions that need scoring, fuzzy matching, and so on.
- There's also internal function:
protected function completionSearchBackend( $search )
That is what SearchEngine implementation (like CirrusSearch) will override. SearchEngine base class deals with namespace handling, result ordering, etc.
- TitlePrefixSearch and StringPrefixSearch will be deprecated (but stay
in code almost unchanged for now) and use of SearchEngine APIs is recommended, such as SearchEngine::defaultPrefixSearch() or completionSearch() depending on whether simple or advanced handling is desired.
- Hooks PrefixSearchBackend and PrefixSearchExtractNamespace will be
deprecated, and overriding completionSearchBackend() and normalizeNamespaces() in SearchEngine is recommended instead. For now, these hooks will be supported by base SearchEngine implementation, but not by CirrusSearch.
The task for this is https://phabricator.wikimedia.org/T121430, it also links the patches as they are now (still work in progress). -- Stas Malyshev smalyshev@wikimedia.org
discovery mailing list discovery@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/discovery
On 29 January 2016 at 02:43, billinghurst billinghurstwiki@gmail.com wrote:
Can this be put into non-geek? As a user it is not evident what is being achieved, how it is being achieved, or how it is being changed. How advanced users on wiki can use and superuse the functionality expressed..
This is intentionally a technical post, soliciting feedback on the technical approach. :-)
The changes Stas are talking about are mostly refactoring https://en.wikipedia.org/wiki/Code_refactoring which will not, in and of itself, affect anything user-facing. That said, Stas is working on this primarily to lay the groundwork towards resolving T121430 https://phabricator.wikimedia.org/T121430, which would enable a greater rollout of the completion suggester; you can see that that task blocks T121616 https://phabricator.wikimedia.org/T121616, which is the task which tracks things we need to do to roll the completion suggester out more broadly.
Hopefully that provides some context. :-)
Thanks, Dan