Page MenuHomePhabricator

"You may create the page" suggestion does not appear if search contains 'AND', 'OR', 'NOT' anywhere in search even when these are not used as special syntax
Closed, ResolvedPublic

Description

When search result does not contain the search text, user receives a suggestion You may create the page "$1" (MediaWiki:Searchmenu-new)

When the search text contains 'AND', 'OR', 'NOT' written in capital letters at the beginning or in the middle (but not in the end) this suggestion does not appear.

This was discovered in Ukrainian Wikipedia for "AMANDA " but is being watched elsewhere.

Compare (enwiki):

Event Timeline

Ata created this task.Dec 23 2015, 5:24 PM
Ata raised the priority of this task from to Needs Triage.
Ata updated the task description. (Show Details)
Ata added a project: CirrusSearch.
Ata added a subscriber: Ata.
Restricted Application added a project: Discovery. · View Herald TranscriptDec 23 2015, 5:24 PM
Restricted Application added subscribers: StudiesWorld, Base, Aklapper. · View Herald Transcript
Deskana triaged this task as Lowest priority.Dec 23 2015, 5:59 PM
Deskana added a subscriber: Deskana.

Good catch. Since this doesn't really affect too much, the priority is very low for us to fix, however.

Deskana moved this task from Needs triage to Search on the Discovery board.Dec 23 2015, 5:59 PM
TJones added a subscriber: TJones.Aug 4 2016, 9:31 PM
Restricted Application added a project: Discovery-Search. · View Herald TranscriptAug 4 2016, 9:31 PM
Deskana renamed this task from "You may create the page" suggestion does not appear if search contains 'AND', 'OR', 'NOT' to "You may create the page" suggestion does not appear if search contains 'AND', 'OR', 'NOT' anywhere in search even when these are not used as special syntax.Aug 8 2016, 5:45 PM
Deskana set Security to None.
debt raised the priority of this task from Lowest to Normal.Aug 11 2016, 5:01 PM
debt moved this task from needs triage to Up Next on the Discovery-Search board.
debt added a project: good first bug.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptAug 11 2016, 5:01 PM

Looks like we just need word boundaries (\b) around the words in the matching regex.

there might be a few more edge cases that could be looked into, various ways to use AND within a query (perhaps inside phrases?). Handling simple word boundaries probably covers the 99% use case though and would be sufficient.

debt moved this task from Up Next to Current work on the Discovery-Search board.Aug 30 2016, 10:06 PM
debt edited projects, added Discovery-Search (Current work); removed Discovery-Search.

annoyingly it looks like we also consider AND inside quotations to also be query_string syntax, although it isn't ... not sure it's worth handling properly though as it will be a bit of a pain

Change 309187 had a related patch set uploaded (by EBernhardson):
Stricter handling if query_string syntax detection

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

Change 309187 merged by jenkins-bot:
Stricter handling of query_string syntax detection

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

debt closed this task as Resolved.Sep 16 2016, 6:55 PM