Page MenuHomePhabricator

hascaption includes files that have had their captions removed
Closed, ResolvedPublicBUG REPORT


User story: N/A

We have this:
hascaption (including hascaption:*) currently returns all files that ever had a caption, even if that caption has been removed via reversion or edit.

As an example, see the history of as an example. Despite no longer having captions, it shows up in the results for this hascaption search

We want this:
The index needs to properly updated when data is removed, and hascaption/inlabel/incaption need to reflect those changes.

Screenshots (if possible):

Acceptance Criteria:

During development, please test the following:

  • Test this feature while logged in AND logged out
  • Test this feature on at least one mobile browser
  • Test that this feature works on the file page AND the Add Data step on UploadWizard (if applicable, some features only exist on one or the other)

Event Timeline

Not sure the right way to go about it, but the problem is essentially here:

After the label was removed there is no longer a MediaInfo slot on the page, so the MediaInfo indexing code doesn't run. That code needs to provide CirrusSearch with an emtpy array as the value for the stored document to empty out the field.

A reasonable way forward might be to always provide the MediaInfo data for appropriate namespaces, giving a sane empty-value when no MediaInfo exists.

@dcausse thoughts?

@EBernhardson sorry missed your ping.
Yes we need to do like what we do for GeoData: always set an empty array when the data is not available.
My main concern is to avoid triggering a reindex for all the current Pages. Perhaps the super noop has some feature to help with this?

Change 538066 had a related patch set uploaded (by EBernhardson; owner: EBernhardson):
[mediawiki/extensions/WikibaseMediaInfo@master] Always report indexable fields on NS_FILE

Change 538066 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Always report indexable fields on NS_FILE

debt added a subscriber: debt.

closing as this will go out into production this week, yay! :)

DannyS712 added a subscriber: DannyS712.

[batch] remove patch for review tag from resolved tasks