Page MenuHomePhabricator

Images in Commons don't show up in search when using CirrusSearch
Closed, ResolvedPublic

Description

  1. Choose a file, preferably with a simple but rare title: https://commons.wikimedia.org/wiki/Special:Random/File
  2. Enter it in the search bar and choose the "search" (not "go") option, or equivalent, e.g. https://www.mediawiki.org/w/index.php?title=Special%3ASearch&search=File%3ASom+tam+pu.jpg&fulltext=Search&srbackend=CirrusSearch

2-bis) A) Visit the multimedia search tab: https://www.mediawiki.org/w/index.php?title=Special:Search&search=&fulltext=Search&profile=images&redirs=1

B) Search the full filename (without File: prefix), optionally quoted, and try a few times till you get what you should...

I) Actual result: « There were no results matching the query. There is a page named "File:Som tam pu.jpg" on this wiki.»
II) Expected result: the file is among search results (together with other matching filenames if you've not used the quotes). https://www.mediawiki.org/w/index.php?title=Special%3ASearch&search=File%3ASom+tam+pu.jpg&fulltext=Search
II-bis) Same but at https://www.mediawiki.org/w/index.php?title=Special%3ASearch&profile=images&search=Som+tam+pu.jpg&fulltext=Search


Version: master
Severity: normal
URL: https://www.mediawiki.org/w/index.php?title=Special%3ASearch&search=File%3ASom+tam+pu.jpg&fulltext=Search&srbackend=CirrusSearch
See Also:
T7101: Image from Commons doesn't show up when searched in Wikipedia search box
T46420: Restore interwiki (sister projects) results in search queries

Details

Reference
bz53531

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:02 AM
bzimport set Reference to bz53531.

The images don't show up in either the new or old search. Do we expect them to? We do support stuff brought on to the wiki via instant commons.

(In reply to comment #1)

The images don't show up in either the new or old search.

They do in the old, see the steps above. I hope they are clear enough.

Do we expect them
to? We do support stuff brought on to the wiki via instant commons.

What do you mean support, if you say they don't show up?

Created attachment 13195
Local search with Commons files

Attached:

CommonsClientSearch.png (900×1 px, 209 KB)

(In reply to comment #2)

(In reply to comment #1)

The images don't show up in either the new or old search.

They do in the old, see the steps above. I hope they are clear enough.

Oddly they show up sometimes but not others. Reload the page and they go away. Chad or I will have a look at that soon.

Do we expect them
to? We do support stuff brought on to the wiki via instant commons.

What do you mean support, if you say they don't show up?

I was thinking you wanted some cross-wiki search. I suppose by support I mean if you, say, add an image to a page using instant commons then that image should become searchable "real quick". That doesn't seem to be working.

And after further investigation it looks like I lied about this working - we have a test for uploading a file and a test that uses instant commons to include a video but that test doesn't ensure that the video is searchable.

Triaging high.

This will have to work both for forceSearchIndex.php and in process updates.

So I did a bit more digging and the way we do it now is to always search in the commonswiki index if searching in the FILE namespace. I'm pretty sure something similar is the only way we're going to get the same kind of feature out of CirrusSearch. Indexing multiple copies of commons is just silly and indexing just

I don't really like the idea though because it makes commons special and it is very WMF specific. And it means one wiki would be talking to another wiki's search index which makes rolling deploys very nasty indeed.

I wonder if we could implement this using an API request to commons wiki or maybe just by providing a link to the same search in commons wiki. That'd keep rolling upgrades simpler. Using the API wouldn't allow us to mix the search results because scoring wouldn't be the same. Actually, I'm pretty sure we'd have the same problem if we tried to share commonswiki's search index too.

I'm going to set this bug aside for now while I think about what to do.

If it did not work with the old search, I guess this bug can be flagged as an enhancement request.

Sorry if this isn't clear - it works in the current search.

Adding On_Hold whiteboard. I'll be ignoring this for the time being even though it is truly a high priority bug. In this case I'm ignoring it because the solution is difficult and probably worth thinking about in the context of a feature we'd like to revive: interwiki search. In other words. I'll get to it but not as fast as its priority implies I should.

Change 98986 had a related patch set uploaded by Chad:
Implement multi-index support on a per-namespace basis

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

Change 98986 merged by jenkins-bot:
Implement per-namespace cross wiki searching

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

Working on labs, just need a window to get commonswiki in production indexed :)

WOW! Can't wait to test it in production.

Very nice!

I guess one day we will be able to replace Special:NewFiles with Special:Search+ some parameters :-D