Hi Everyone,
As discussed in more detail in Phabricator ticket T228925 https://phabricator.wikimedia.org/T228925, it turns out that parentheses and the boolean operators AND and OR do not actually work as advertised in the documentation. The short term plan is to update the documentation to reflect current reality, and the long term plan is to fix reality to reflect the currently aspirational documentation.
Here's the first draft of the update to go in the Help:Searching Logical operators https://en.wikipedia.org/wiki/Help:Searching#Logical_operators section:
The search engine supports *limited* boolean logic in searches. Logical NOT (negation) can be indicated by a "-" (minus sign) or a "!" (exclamation point) character prefixed to a search term, or by the NOT keyword.
Parentheses (…) are ignored by the search engine and have no effect.
The operators AND and OR are used by the search engine, but *do not have
the expected boolean logical meaning* and should be used with great care. See the additional documentation https://www.mediawiki.org/wiki/User:TJones_(WMF)/Drafts/Logical_operators_in_on-wiki_search for an in-depth explanation.
I've also written a draft of the longer explanation (~1200 words) of the use of Logical operators in on-wiki search https://www.mediawiki.org/wiki/User:TJones_(WMF)/Drafts/Logical_operators_in_on-wiki_search . *Feedback is much appreciated!*
I still need to review the rest of the Help:Searching page and mw:Help:CirrusSearch page to see if any other changes are needed there.
Thanks,
—Trey
Trey Jones Sr. Software Engineer, Search Platform Wikimedia Foundation UTC-4 / EDT