Page MenuHomePhabricator

Default to article search on commons + wikibase (aka SDC)
Closed, ResolvedPublic

Description

When searching on commons with SDC stuff enabled we get the warning:

https://test-commons.wikimedia.org/w/index.php?search=cat&title=Special%3ASearch&go=Go

A warning has occurred while searching: Mixing entity and article namespaces in search is currently not supported. Only entity namespaces will be searched.

The day before this is deployed to commons they will only have article searches. On the day it is deployed we would like it to be the same, the entity namespace should only be searched if only that namespace is selected. SDC would additionally like no warning message to be displayed.

This is a band-aid solution to help them make the initial deployment

Event Timeline

If necessary, we can completely disable entity search initially. In that case any SDC stuff that is surfaced would be through the copying that happens between the structured data and the opening_text field

From convo about way forward:

14:34 <+ebernhardson> SMalyshev: they basically want to deploy SDC without breaking commons. If that means they don't have entity search on day 1 that's 
                      ok
14:34 <+SMalyshev> we don't have article+wikibase search
14:34 <+ebernhardson> SMalyshev: today on test-commons searching only searches entities, and not articles, which is not deployable
14:34 <+SMalyshev> yep so we can exclude entity namespace from defaults
14:35 <+SMalyshev> that would make it the same as before I presume
14:35 <+SMalyshev> wouldn't that be the easiest way?
14:35 <+ebernhardson> i mentioned that taking it out of the default searchable namespaces would be pretty easy, but ramsay was still worried. He seemed 
                      to prefer completely disabling entity search over making it available with that warning message
14:36 <+SMalyshev> well, I am not sure you can completely disable entity search right now...
14:36 <+SMalyshev> well maybe you can if you set query builder to standard one.
14:36 <+SMalyshev> that would make it old search
14:36 <+ebernhardson> I could add a config flag that basically says "dont add special query builder" ?
14:37 <+SMalyshev> ebernhardson: we already have this
14:37 <+ebernhardson> so that might be reasonable, which is it? I'll hack up beta and see if it works in a way acceptable to them
14:39 <+SMalyshev> so in WikibaseSearchSettings, look for wmgBuilderClass
14:39 <+SMalyshev> right now it chooses between the two entity searchers. But you can make it choose default one
14:39 <+SMalyshev> non-entity one
14:39 <+ebernhardson> ok, thanks i'll test it out and ping them with results
14:39 <+SMalyshev> for commons. You can add a variable for it or just make it compare wiki name, however you think is easier
14:40 <+SMalyshev> I *think* that should fix the issue for now (well, but disabling entity search of course)
14:41 <+SMalyshev> ebernhardson: though may be better would be to make a different profile
14:41 <+SMalyshev> ebernhardson: yeah I think applying wrong class to a profile may be wrong... so maybe better to assign different profile instead
14:41 <+SMalyshev> so we have $wgWBRepoSettings['entitySearch']['fulltextSearchProfile'] = 'wikibase_config_fulltext_query';
14:42 <+SMalyshev> we can make it something else for commons maybe... let me see how the dispatch actually works...
14:44 <+SMalyshev> ebernhardson: ah dammit no it won't work
14:45 <+SMalyshev> the dispatcher checks if there's a mix of acticle/non-article NSes, it doesn't care whether the classes are actually the same
14:45 <+ebernhardson> hmm, can add a check?
14:46 <+SMalyshev> so what we'd need to do is to make onCirrusSearchFulltextQueryBuilderComplete hook to deactivate.
14:46 <+SMalyshev> probably add a variable for it, since setting UseCirrus to false would shut off all searches, including wbsearchentity
14:46 <+SMalyshev> if we just want to shut off fulltext, we probably need another var
14:47 <+ebernhardson> sounds reasonable, i'm going to copy all the above into ticket
14:47 <+SMalyshev> changing profiles won't help since dispatching builder does all the checks before anything else
14:47 <+SMalyshev> (maybe when we move DispatchingQueryBuilder inside Cirrus, it will be easier)

TLDR of the above: if we want to disable entity fulltext searching, we need to add variable that shuts off onCirrusSearchFulltextQueryBuilderComplete hook.

verified with quick hack on mwdebug1001 that shutting off the hook brings standard image search back to test-commons.wikimedia.org. Will work up a patch for WikibaseCirrusSearch and duplicate to Wikibase.

Not sure you need duplicate to Wikibase as everything in production is supposed to run on WikibaseCirrusSearch now, and Wikibase hooks are planned to be removed soon (for varying definitions of soon depending on how Lexeme deployment is progressing). Wouldn't hurt to have it, but not sure if necessary.

Turns out WBCS wasn't deployed to testcommonswiki yet. Will be deployed monday (ish) via https://gerrit.wikimedia.org/r/#/c/operations/mediawiki-config/+/498442/

Change 498459 had a related patch set uploaded (by EBernhardson; owner: EBernhardson):
[mediawiki/extensions/WikibaseCirrusSearch@master] Allow SDoC to disable entity fulltext search for initial deployment

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

Change 498459 merged by jenkins-bot:
[mediawiki/extensions/WikibaseCirrusSearch@master] Allow SDoC to disable entity fulltext search for initial deployment

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

Change 499845 had a related patch set uploaded (by Smalyshev; owner: EBernhardson):
[mediawiki/extensions/WikibaseCirrusSearch@wmf/1.33.0-wmf.23] Allow SDoC to disable entity fulltext search for initial deployment

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

Change 499845 abandoned by Smalyshev:
Allow SDoC to disable entity fulltext search for initial deployment

Reason:
This depends on a bunch of bugfixes, which are not cherry-picked. In order to avoid dragging the kitchen sink in, I think we'd just wait for the train with this for the next week.

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

Change 500070 had a related patch set uploaded (by EBernhardson; owner: EBernhardson):
[operations/mediawiki-config@master] Disable wbcs dispatching query builder on commons

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

Change 500777 had a related patch set uploaded (by EBernhardson; owner: EBernhardson):
[operations/mediawiki-config@master] Disable wbcs dispatching query builder on commons (2/3)

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

Change 500778 had a related patch set uploaded (by EBernhardson; owner: EBernhardson):
[operations/mediawiki-config@master] Disable wbcs dispatching query builder on commons (3/3)

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

Change 501432 had a related patch set uploaded (by EBernhardson; owner: EBernhardson):
[operations/mediawiki-config@master] Disable wbcs dispatching query builder on commons (3/3)

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

Change 501432 abandoned by EBernhardson:
Disable wbcs dispatching query builder on commons (3/3)

Reason:
This already existed as I985dab26de55616e3627bef569428e2c06150905

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

Change 501436 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[operations/mediawiki-config@master] Enable WBCS search on commons too

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

Change 500070 merged by jenkins-bot:
[operations/mediawiki-config@master] Disable wbcs dispatching query builder on commons (1/3)

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

Mentioned in SAL (#wikimedia-operations) [2019-04-08T23:10:25Z] <ebernhardson@deploy1001> Synchronized wmf-config/: T218954: Disable wbcs dispatching query builder on commons (1/3) (duration: 00m 52s)

Change 500777 merged by jenkins-bot:
[operations/mediawiki-config@master] Disable wbcs dispatching query builder on commons (2/3)

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

Mentioned in SAL (#wikimedia-operations) [2019-04-08T23:33:33Z] <ebernhardson@deploy1001> Synchronized wmf-config/Wikibase.php: T218954: Disable wbcs dispatching query builder on commons (2/3) (duration: 00m 52s)

Change 500778 merged by jenkins-bot:
[operations/mediawiki-config@master] Disable wbcs dispatching query builder on commons (3/3)

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

Mentioned in SAL (#wikimedia-operations) [2019-04-08T23:41:40Z] <ebernhardson@deploy1001> Synchronized wmf-config: T218954: Disable wbcs dispatching query builder on commons (3/3) (duration: 00m 51s)

Mentioned in SAL (#wikimedia-operations) [2019-04-08T23:45:11Z] <ebernhardson@deploy1001> Synchronized wmf-config: T218954: Disable wbcs dispatching query builder on commons (3/3) (duration: 00m 52s)

Change 501436 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable WBCS search on commons too

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

Mentioned in SAL (#wikimedia-operations) [2019-04-08T23:57:11Z] <ebernhardson@deploy1001> Synchronized wmf-config/InitialiseSettings.php: T218954: Enable WBCS search on commons too (duration: 00m 50s)