[Story] Search for Wikidata should give meaningful results on mobile as well
Closed, ResolvedPublic

Description

The search on mobile for Wikidata needs to use the entity selector like the desktop version does. Otherwise only page titles are found which are the item ids on WIkidata.

There are a very large number of changes, so older changes are hidden. Show Older Changes
Bene added a comment.Aug 26 2015, 7:36 AM

See P1923 for a proposal how a custom search api for wikibase could look like.

@Bene can you turn your proposal into a patch? That would make it much easier to test and to comment.

Bene added a comment.Aug 26 2015, 3:00 PM

Note that this proposal only makes sense if T110069 gets tackled which mainly depends on these two patches: https://gerrit.wikimedia.org/r/233479 and https://gerrit.wikimedia.org/r/233481

I didn't get an answer by @Jdlrobson on my patch yet and he didn't comment on the other one as well.

Bene moved this task from Doing to Review on the Wikidata-Sprint-2015-08-18 board.Aug 26 2015, 9:25 PM
Bene moved this task from Review to Doing on the Wikidata-Sprint-2015-08-18 board.
Bene added a comment.Aug 28 2015, 11:14 AM

Current state of this: in the short term we may replace the javascript module to make the search work basically. However, we want to use cirrus search on Wikidata anyways and that would also solve this issue. This is the long term solution which should be used for desktop and mobile search.

@Bene If replacing teh JS module proves to be problematic, we can also provide an API module that wraps sbsearchentities and emulates the output format used by core's title search.

Bene added a comment.Aug 28 2015, 1:04 PM

@daniel I also considered that. What about specifying a parameter in wbsearchentities that enables core's search format. This way we can avoid breaking the api output and do not have another module cluttering our api.

@Bene: a separate module would be cleaner, both from the "inside" and the "outside". Adding an option thaqt completely changes the structure of the output is bound to cause confusion, and it leads to multi-option multi-purpose code, which tends to be hard to maintain.

In particular, it's going to be much easier to just remove a module, than to remove an option and clean up the relevant code pathes.

Bene added a comment.Aug 28 2015, 3:50 PM

After looking deeper into the search api call, I see that MobileFrontend uses prefixsearch only as a generator and gets all the relevant data via action=query&prop=thumbnail. This makes the whole thing a bit harder. I'm not sure if we want to replicate such a specific query including generators etc. in a fake api. In future however, we should perhaps implement some page props that work for Wikibase entities.

The full query is

{
	action: 'query',
	generator: 'prefixsearch',
	gpssearch: query,
	gpsnamespace: this.searchNamespace,
	gpslimit: 15,
	prop: 'pageimages',
	piprop: 'thumbnail',
	pithumbsize: mw.config.get( 'wgMFThumbnailSizes' ).tiny,
	pilimit: 15,
	redirects: '',
	list: 'prefixsearch',
	pssearch: query,
	pslimit: 15
}

Change 234560 had a related patch set uploaded (by Bene):
Create MediawikiSearchEntities api module

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

Change 234675 had a related patch set uploaded (by Bene):
Allow to use custom displayTitle in search

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

kaldari removed a subscriber: kaldari.Aug 28 2015, 10:44 PM

Change 234675 merged by jenkins-bot:
Allow to use custom displayTitle in search

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

Bene moved this task from Doing to Review on the Wikidata-Sprint-2015-08-18 board.Aug 31 2015, 9:58 AM
Bene added a comment.Sep 1 2015, 12:45 PM

https://gerrit.wikimedia.org/r/#/c/234560/ isn't finished yet but I want to get some review first to see if the team agrees this is the right way to go. I will create tests and fix jenkins after I got a +1.

Bene moved this task from Doing to Review on the Wikidata-Sprint-2015-09-01 board.Sep 2 2015, 8:25 AM
daniel added a comment.Sep 2 2015, 3:10 PM

@Bene please add a subtask for the new API module, so we can track that separately.

daniel renamed this task from [Task] search for Wikidata should use entity selector on mobile as well to [Story] search for Wikidata should use entity selector on mobile as well.Sep 2 2015, 3:11 PM
Bene removed Bene as the assignee of this task.Sep 15 2015, 9:45 AM
Bene added a subscriber: Bene.

Change 238983 had a related patch set uploaded (by Bene):
Configure MobileFrontend to use wbsearch as generator

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

Lydia_Pintscher renamed this task from [Story] search for Wikidata should use entity selector on mobile as well to [Story] Search for Wikidata should give meaningful results on mobile as well.Nov 17 2015, 2:31 PM

Change 254645 had a related patch set uploaded (by Bene):
Use custom generator for mobile search on Wikibase

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

Change 238983 abandoned by Bene:
Configure MobileFrontend to use wbsearch as generator

Reason:
Done in config: https://gerrit.wikimedia.org/r/#/c/254645/1

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

Bene claimed this task.Nov 21 2015, 2:06 PM
Bene moved this task from Backlog to Review on the Wikidata-Sprint-2015-11-17 board.
Bene added a comment.Nov 25 2015, 11:31 AM

The only thing for this to be done is getting the config patch merged: https://gerrit.wikimedia.org/r/#/c/254645/ Maybe someone can have a look into that?

@JanZerebecki could you have a look at that as well?

daniel changed Security from None to Software security bug.Nov 26 2015, 12:42 PM
Restricted Application changed the visibility from "Public (No Login Required)" to "Custom Policy". · View Herald TranscriptNov 26 2015, 12:42 PM
Restricted Application changed the edit policy from "All Users" to "Custom Policy". · View Herald Transcript
Restricted Application added a project: Security. · View Herald Transcript
JanZerebecki changed Security from Software security bug to None.Nov 26 2015, 12:47 PM
Aklapper changed the visibility from "Custom Policy" to "Public (No Login Required)".Nov 26 2015, 1:08 PM
Aklapper changed the edit policy from "Custom Policy" to "All Users".

Tested this locally, with the following settings:

$wgMFNearby = true;
$wgMFQueryPropModules[] = 'pageterms';
$wgMFSearchAPIParams['wbptterms'] = array( 'label' );
$wgMFSearchGenerator = array(
	'name' => 'wbsearch',
	'prefix' => 'wbs'
);

I tested with latest master of core, Wikibase, and MobileFrontend.

I found the following:

  • In the search box, I get matches for labels, but labels are not used for display. I just see IDs, no labels or descriptions.
  • On Special:Nearby, labels are used for display, but no descriptions are shown.
  • Also, I found T119707
Bene added a comment.EditedNov 26 2015, 3:55 PM
  • In the search box, I get matches for labels, but labels are not used for display. I just see IDs, no labels or descriptions.

Matched terms will be shown as soon as https://gerrit.wikimedia.org/r/#/c/251207/ is merged.

  • On Special:Nearby, labels are used for display, but no descriptions are shown.

I don't know how Special:Nearby works but that is unrelated to this task.

Perhaps my MobileFrontend patch suffers from the same issues... :S

So, this is blocked on https://gerrit.wikimedia.org/r/#/c/251207/ as far as I can tell.

aude added a comment.Dec 2 2015, 1:03 PM

Tested this locally, with the following settings:

$wgMFNearby = true;
$wgMFQueryPropModules[] = 'pageterms';
$wgMFSearchAPIParams['wbptterms'] = array( 'label' );
$wgMFSearchGenerator = array(
	'name' => 'wbsearch',
	'prefix' => 'wbs'
);

I tested with latest master of core, Wikibase, and MobileFrontend.

I found the following:

  • In the search box, I get matches for labels, but labels are not used for display. I just see IDs, no labels or descriptions.
  • On Special:Nearby, labels are used for display, but no descriptions are shown.

Do you have the following settings?

$wgMFUseWikibaseDescription = true;                                                                 
$wgMFDisplayWikibaseDescription = true;

descriptions are a separate, general feature that works on any client wiki, including wikidata.

alternatively:

$wgMFSearchAPIParams['wbptterms'] = array( 'label', 'description' );

might work.

daniel added a comment.Dec 3 2015, 3:35 PM

@aude thanks, with the two extra settings, it works as expected.

Still blocked on minor escaping and naming issues in https://gerrit.wikimedia.org/r/#/c/251207/

adrianheine raised the priority of this task from Normal to High.
Bene added a comment.EditedJan 27 2016, 1:04 PM

Patches that need to be merged:

When done, this can be closed as resolved.

Change 254645 merged by jenkins-bot:
Use custom generator for mobile search on Wikidata

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