Page MenuHomePhabricator

Negating deepcategory keyword
Closed, ResolvedPublic

Description

All search-keywords can be prefixed with a - to subtract it's results from the results of the other search parameters (negative). So should deepcategory behave.

Instead currently deepcategory:"foo" -deepcategory:"bar" is a synonym for deepcategory:"foo" deepcategory:"bar" i.e. it searches for articles that are in both categories "bar" and "foo".

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 26 2018, 10:30 PM
Smalyshev renamed this task from Excluding deepcategory to Negating deepcategory keyword.Apr 28 2018, 7:46 AM
Smalyshev added subscribers: dcausse, Smalyshev.

I suspect this needs more general solution for negating keywords. I thought it should work OOB by filters configuration, but maybe something is wrong there. @dcausse do you know if it's supposed to work?

Yes it's supposed to work, @MichaelSchoenitzer_WMDE do you have a specific example to share?
Searching for deepcat:"Lemurs" -deepcat:"Subfossil lemurs" returns different results than deepcat:"Lemurs" deepcat:"Subfossil lemurs".

This is the example I tested: deepcategory:"Friedhof in Köln" -deepcategory:"Jüdische Trauerhalle in Deutschland" (on dewiki).
It will find only the one page in both categories but none of the categories in all of the first but not the second category (should return 20 results).

Indeed there seem to be a weird bug, searching for deepcat:"Friedhof in Köln" -deepcat:"Jüdische Trauerhalle in Deutschland" works properly.
deepcategory is an alias to deepcat so I bet there is something weird going on with negation and keyword aliases.
I'll look into it. Thanks!

dcausse claimed this task.Apr 30 2018, 5:06 PM
dcausse triaged this task as Normal priority.

Change 429844 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Keyword aliases should support negation

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

Change 429844 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Keyword aliases should support negation

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

Smalyshev closed this task as Resolved.May 4 2018, 6:37 AM
Vvjjkkii renamed this task from Negating deepcategory keyword to f4daaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed dcausse as the assignee of this task.
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from f4daaaaaaa to Negating deepcategory keyword.Jul 2 2018, 3:06 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to dcausse.
CommunityTechBot lowered the priority of this task from High to Normal.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.