15

I wanted to find all the posts containing the phrase call or call. In my case, I'll demonstrate on Stack Overflow, but this happens on Stack Exchange search too, so this isn't just an Stack Overflow issue. So, I typed "call or call" into the search bar. It says this, so I imagined it would only search for that exact phrase.

"words here" exact phrase

Here is the search if you want to try it. Unfortunately, as I looked through them, many did not contain the exact words "call or call". As cigien realized, the search is also finding results for call [inline code here][optional punctuation] or call. So it appears that in searching, it will also return results where, if my search contains a space, the space can really also be inline code or punctuation. I tried running a SEDE query to show results for call or call, which returned what I expected (only results that matched that exactly.

Another example is "use to". Typing that in search returns results for things like

use git reflog to determine...

You can find similar results if you search for "use for" or any two words that would commonly have inline code between them.

Also, A new search engine for Stack Exchange says

Quoted phrases are exact matches except for case-sensitivity, for example, you can search for code or symbols.

That makes me suspect this is a bug, and not the intended behavior.

I'd like it to return exact results only, or maybe results where the spaces in the query are considered "any whitespace character" in search, but I don't think considering inline code as spaces makes sense.

Can search be updated to only search for my exact phrase when I use double quotes and not automatically substituting spaces in "exact match" queries with "space or punctuation or inline code", please?

8
  • "or" could be interpreted as a Boolean operator. Here is a search that seems to work as intended. Can such operators be escaped? Aug 23 at 17:14
  • 2
    @This_is_NOT_a_forum Huh... I'd still expect a raw string to not have operators apply to it, although you could be right
    – cocomac
    Aug 23 at 17:31
  • 4
    @This_is_NOT_a_forum The OR operator is only for tag searches: [widgets] or [geegaws] It does not work with other searches. See "sort array" which has 4227 results, "reverse array" which has 401 results but "sort array" or "reverse array" does not combine them, instead brings zero results.
    – VLAZ
    Aug 23 at 19:35
  • "Searching for [python] (i.e., the Python tag) gives just under 4.9 million results" what is the exact search text? To the best of my knowledge if you type in [python] in the search you would get the Python page. Clicking on the tag does the same. There is actually a separate functionality for tag searching (the URL you go to is /tagged/<searched tags>) and other searches - anything that includes text (the URL is /search?q=<search text>). They would give you somewhat different results in some occasions but if you only search for a tag, you trigger the tag search feature.
    – VLAZ
    Aug 25 at 7:06
  • @VLAZ I meant literally typing [python] ( stackoverflow.com/search?q=%5Bpython%5D ) which is labeled "search within a tag", which I'd expect to have the same number of questions as the Python tag (unless I add more to my search than "anything in that tag"). For comparison, here is it through the tag menu, which displays a different nmber of questions
    – cocomac
    Aug 25 at 7:08
  • stackoverflow.com/search?q=%5Bpython%5D leads me to stackoverflow.com/questions/tagged/python which is also the same page you go to if you click on the Python tag. If you did somehow go to the /search page, then the discrepancy of numbers of results is probably because it lists questions and answers. So [python] is:q should show the correct(-er) number of results. I'd expect some small discrepancy maybe within 100 or less but not anything close to 2mil vs 4mil
    – VLAZ
    Aug 25 at 7:12
  • Ohh, I see. I'll roll back the edit, I didn't realize that
    – cocomac
    Aug 25 at 7:13
  • 1
    Yep, just checked: [python] is:q has ~2 million results and [python] is:a has ~2.8 million results, so that matches the total of 4.9 million you saw.
    – VLAZ
    Aug 25 at 7:14

0

You must log in to answer this question.

Browse other questions tagged .