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):

en1.PNG (573×851 px, 68 KB)
en2.PNG (578×850 px, 65 KB)

Event Timeline

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 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 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 Medium.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 task.

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.

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