Page MenuHomePhabricator

Implement completion suggester as a Beta Feature
Closed, ResolvedPublic

Details

Related Gerrit Patches:

Event Timeline

EBernhardson raised the priority of this task from to Needs Triage.
EBernhardson updated the task description. (Show Details)
EBernhardson added a subscriber: EBernhardson.
Restricted Application added a project: Discovery. · View Herald TranscriptSep 9 2015, 11:30 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
dcausse claimed this task.Sep 10 2015, 7:13 AM
dcausse set Security to None.
Deskana triaged this task as Medium priority.Sep 10 2015, 4:45 PM
Deskana added a subscriber: Deskana.

Change 237692 had a related patch set uploaded (by DCausse):
Add searchSuggestions to SearchEngine

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

Change 237693 had a related patch set uploaded (by DCausse):
Implement searchSuggestions from SearchEngine

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

aude added a subscriber: aude.Sep 13 2015, 2:05 PM

Needs to get done eventually, but it's not super high priority right now.

Taking this off the sprint board to reflect reality; this just isn't being prioritised right now.

EBernhardson added a comment.EditedNov 25 2015, 3:37 PM

We talked in the planning meeting yesterday that we should start this out as an opt-in beta feature. There are some high-level instructions for beta features here: https://www.mediawiki.org/wiki/Beta_Features#Creating_your_own

From within php code the check is something like:

if ( class_exists( 'BetaFeatures' ) && BetaFeatures::isFeatureEnabled( $GLOBALS['wgUser'], 'my-feature-name' ) ) {
   // enabled
} else {
  // disabled
}

To add this to the beta features dialog (in user preferences) we need a hook handler similar to MultimediaViewer: https://github.com/wikimedia/mediawiki-extensions-MultimediaViewer/blob/master/MultimediaViewerHooks.php#L243-L263

That has to be added to $wgHooks in the top level CirrusSearch.php file, something like:

$wgHooks['GetBetaFeaturePreferences'][] = 'CirrusSearch\Hooks::getBetaFeaturePreferences'

If everything works right it should end up in the beta features user preferences, such as: https://www.mediawiki.org/wiki/Special:Preferences#mw-prefsection-betafeatures

Change 256407 had a related patch set uploaded (by DCausse):
Extracted some code from PrefixSearch for re-usability by other search engines.

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

dcausse renamed this task from Add an internal completion or suggestions API to core SearchEngine to Implement completion suggester as a Beta Feature.Dec 2 2015, 2:32 PM
dcausse updated the task description. (Show Details)

Change 256407 merged by jenkins-bot:
Extracted some code from PrefixSearch for re-usability by other search engines.

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

This will need the titlesuggest indices built for all wikis, and some way of updating them since they can't be built in real time by normal edits.

I've created https://gerrit.wikimedia.org/r/256974 to add definitions that allow the titlesuggest indices to be built, not sure yet about updating them. The obvious way would be a cron job of some sort via puppet. Following other examples, such as modules/mediawiki/manifests/maintenance/pagetriage.pp, we would create a cirrussearch.pp and add mediawiki::maintenance::cirrussearch to terbium.

Change 258068 had a related patch set uploaded (by EBernhardson):
[WIP] Cron job to rebuild completion indices

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

Change 237693 merged by jenkins-bot:
Add Completion Suggester as a Beta Feature

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

Deskana closed this task as Resolved.Dec 15 2015, 5:40 PM

Change 258068 had a related patch set uploaded (by EBernhardson):
Cron job to rebuild completion indices

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

Change 258068 merged by Dzahn:
Cron job to rebuild completion indices

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

Dzahn added a subscriber: Dzahn.Dec 17 2015, 5:47 PM

on terbium:

Notice: /Stage[main]/Mediawiki::Maintenance::Cirrussearch/Cron[cirrus_build_completion_indices_eqiad]/ensure: created
Notice: /Stage[main]/Mediawiki::Maintenance::Cirrussearch/File[/var/log/mediawiki/cirrus-suggest]/ensure: created
Notice: /Stage[main]/Mediawiki::Maintenance::Cirrussearch/Cron[cirrus_build_completion_indices_codfw]/ensure: created
Notice: /Stage[main]/Mediawiki::Maintenance::Cirrussearch/File[/etc/logrotate.d/cirrus-suggest]/ensure: defined content as