Page MenuHomePhabricator

Build internal cirrus api for query completion
Closed, DeclinedPublic13 Estimated Story Points

Description

As a developer building query completion i want cirrussearch to have an api exposing those query completions so that frontend integration has a way to access the completions


Query Builder

Evaluate reusability of CompSuggestQueryBuilder. Many useful concepts, query profiles supporting fuzziness, discounting fuzzy results, variants (will we use those for query completion?). etc. While building looks to be mostly generic the post-processing is highly specific to the exact index structure and the concept of Titles as the result type.


CompletionSuggester

The current CompletionSuggester impl is about the specific task of deciding how to route a title completion request between multiple backends (completion and prefix), processing/merging those results. The concept of returning Titles is baked in at this level as well. Nothing here in particular seems reusable, but query completion will need something with the same top level concept of running the builder impl and passing those queries through elasticsearch. Existing CompletionSuggester might be renamed TitleCompletionSuggester for clarity vs whatever query completion does.


Public MW API

Provide a very simple api surface, ideally a single option prefix should be provided and a plain list of query completions should be returned. At some point we may want to consider adding context, but it's not clear what that should be today. This needs to gracefully handle a wiki that is not configured with query completion. If possible it should not be registered as a possible api request for wikis it's not enabled on. This should be marked experimental in the i18n strings used as api docs, as we are not certain it will stay in this form.

This needs to be compatible with whatever the frontend is doing, likely some investigation into how prefixsearch is invoked by the frontend will be necessary.

Related Objects

Event Timeline

CBogen set the point value for this task to 13.Aug 24 2020, 5:18 PM
Gehel triaged this task as High priority.Oct 28 2020, 1:28 PM

Change 697934 had a related patch set uploaded (by ZPapierski; author: ZPapierski):

[mediawiki/extensions/CirrusSearch@master] Add QueryCompletionSuggester and completion index

https://gerrit.wikimedia.org/r/697934

Change 700497 had a related patch set uploaded (by ZPapierski; author: ZPapierski):

[mediawiki/vagrant@master] Add query completion auto index pattern

https://gerrit.wikimedia.org/r/700497

Change 700497 merged by jenkins-bot:

[mediawiki/vagrant@master] Add query completion auto index pattern

https://gerrit.wikimedia.org/r/700497