Page MenuHomePhabricator

Provide better messages if the search phrase contains part of the "search syntax"
Closed, ResolvedPublic

Description

Consider the following examples

  1. "two or three words"

http://en.wikipedia.org/w/index.php?title=Special:Search&search=%22two+or+three+words%22&fulltext=Search

The page [["two or three words"]] doesn't exists and MW shows the message

There were no results matching the query.

Create the page ""two or three words"" on this wiki!

Since the quotes have a special meaning when used among the search terms, i.e. they are part of the "search syntax", the messages should be more contextualized. For example, if we search for "some words on Google Search Engine", we will get:

http://www.google.com/search?q=%22some+words+on+Google+Search+Engine%22

No results found for "some words on Google Search Engine".
Results for some words on Google Search Engine (without quotes):

...

  1. intitle:Another example

http://en.wikipedia.org/w/index.php?title=Special:Search&search=intitle%3Aanother+example&fulltext=Search

There were no results matching the query.

Create the page "Intitle:another example" on this wiki!

the string "intitle" also has a special meaning, so when the user uses it, and get no results, MW could provide some indication that by dropping that term there could be some result.

The same idea applies to other strings having special meanings, such as "prefix" and symbols like "-" which is used to exclude some of the possible results.


Version: 1.20.x
Severity: normal
URL: https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=505315152#Article_titles_containing_.22prefix:foo.22

Details

Reference
bz29989

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:36 PM
bzimport set Reference to bz29989.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

The same idea applies to other strings having special meanings, such as
"prefix" and symbols like "-" which is used to exclude some of the possible
results.

...and also to "ondiscussionpage", which is currently used by [[mw:Extension:LiquidThreads]]
http://www.mediawiki.org/w/index.php?title=Special:Search&search=EXAMPLE+ondiscussionpage%3ATalk%3AArticle+feedback&fulltext=1&ns90=1
and may lead to the creation of pages like
http://pt.wikibooks.org/w/index.php?title=Porque_somos_jogados_para_frente_do_%C3%B4nibus_quando_ele_freia_bruscamente_ondiscussionpage:Wikilivros:Pergunte_ao_bibliotec%C3%A1rio&action=edit&redlink=1
which will need to be deleted.

since "intitle:" is part of lucene, I think this would require a fix there, not in mw proper.

There is a thread related to this on enwiki's village pump. I'm adding it above.

7rt1j wrote:

This appears to be a duplicate of bug 21102. (I don't have the option to resolve it as such though.)

  • This bug has been marked as a duplicate of bug 21102 ***