167

Suppose I'm a beginner and I'm confused about my string C:\\having\\double\\backslashes

I search for backslashes appear twice python and I get one result. This one result doesn't answer my question. Even worse, it's totally unrelated and useless for me. It just happened to contain every word of the query, sparsely distributed, and that's it.

If the search engine was any good, it would find me this result: Why do backslashes appear twice?

This one perfectly clarifies my problem. It's a question tagged , and does mention the word Python several times in the answers. It doesn't mention Python in the title, and the community appears to be in the habit of editing tags out of the title in the first place. It's also the top result for backslashes appear twice. How is it that adding the word python into the query has actually defeated the search result?

To filter by tags, I know that I need to search for backslashes appear twice [python], because I'm an experienced user of the site for 10 years. But a new user is not going to know that. They're just going to ask the question again, even though we already have the perfect and high quality answer already on site for it. Maybe a community member will chastise them for not using the search. But it's not entirely their fault, and the UI has to take some of the blame here.

Can we make the search better, please? At the very least, include tags in the query text.

26
  • 21
    Search always has been and probably always will be dumb. Honestly, the best workaround for this is using your favorite real search engine, and recommending it to anyone asking about search Commented Dec 11, 2020 at 20:57
  • 65
    @Zoe I'm aware of the workarounds. The point is we can't keep telling people to search first, when the search feature is trash. Stack exchange need to put some real dev effort into the search engine, especially if it's a feature for "teams" product when using google may not be an option.
    – wim
    Commented Dec 11, 2020 at 21:11
  • 11
    Things I don't like about search: I essentially have to know EXACTLY what I'm looking for short of the actual link, in order to find it. If I search for a plural but the question doesn't have a plural, you won't match it. Also, you cannot search for symbols which is extremely inconvenient on a site that heavily deals with code. There is no special syntax or incantation I know of to force searching for something like the literal string "false". If there is, then there are dozens of other things you cannot actually search for.
    – VLAZ
    Commented Dec 11, 2020 at 21:14
  • 23
    Stack Overflow search is pretty terrible. The only reason you would ever want to use it is if you need the special operators that it provides. Otherwise, I Googled for "backslashes appear twice python", and I got the canonical Q&A as the very first result. It even showed up in a onebox at the top of the results page. And that's for someone who never searches for Python anything, so it's not as if Google is recommending something I've been to many times before.
    – Cody Gray Mod
    Commented Dec 11, 2020 at 21:25
  • 33
    I wonder what is higher on the massive pile of TODOs than a working search box? There was enough dev effort to try out ideas like "Thanks" reaction which does not seem like very high priority to me.
    – wim
    Commented Dec 11, 2020 at 22:08
  • 3
    The search "feature" has caused a lot of confusion over the years and it will continue to do so. I really hope that SE would just rename it something like "Filter" (or actually merge it with the current "Filters" feature), disable keyword searching altogether, and only allow it to be used for filtering (by tags, user id, post type, status, etc.) unless they want to consider improving the searching functionality (which is highly unlikely at this point).
    – 41686d6564
    Commented Dec 11, 2020 at 22:35
  • 10
    @41686d6564 Rebranding the existing one to "filters" is not such a bad idea actually! If backend dev resources are too stretched to improve search itself, then a new search bar could be added to public Q&A which just returns google results for site:stackoverflow.com your query, perhaps.
    – wim
    Commented Dec 11, 2020 at 22:42
  • 4
    I know it would cost money but it would seem that just replacing the search engine with Google Programmable Search Engine would be a fairly minor effort and improve everybody's search experience immensely.
    – Nick
    Commented Dec 12, 2020 at 4:24
  • 18
    The "Ask Question" interface can be used as a search engine. It actually finds the mentioned ID 24085680 with "backslashes appear twice python" (and it is the top hit). It has been like this since the beginning in 2008 and Jeff Atwood mentioned in a podcast episode that he was surprised how well it worked. But it is even less discoverable and is a very unnatural way to operate. It shouldn't be too difficult to provide a better (and discoverable) interface. Commented Dec 12, 2020 at 4:50
  • 1
    Ideally it should prioritise tag matches (in some way), but that would be quite a lot more complex (possibly on the level of rolling out one's own search engine instead of just using Elasticsearch). Just also searching tags shouldn't be that difficult and seems like a pretty basic search requirement. Commented Dec 13, 2020 at 2:31
  • 1
    You gave a perfect example of the tags issue. These questions also highlight other issues with search. The question actually returned by the search function did not include any of the search terms (except “python”) – they were all in answers and comments. The question that should have been returned included all the search terms; even better, it included them in the title (if we consider the title to be “python - Why do backslashes appear twice?”, which is what is displayed in the browser). Commented Dec 13, 2020 at 10:44
  • 1
    "The point is we can't keep telling people to search first, when the search feature is trash." We can but we have to be careful how to phrase it. Something like: "Please search first using a real search engine and not the StackOverflow search, which is really bad and should not be used." That should in principle do the trick. Commented Dec 13, 2020 at 12:25
  • 1
    SE searching tool is pretty good at what it's purposed to do. The tools are mainly meant to searh for posts by the metadata, like a specific user, votes, tags etc. (which common search engines mostly can't find). When searching by metadata, it needs to be specifically formatted to separate it from the actual keywords. Tags are containing too much general words for a simple engine to make a distinction between a tag and a regular keyword, the result would be just be a bunch of false positives. Such a result is almost as poor as no results at all.
    – Teemu
    Commented Dec 14, 2020 at 6:59
  • 2
    We've used to use excellent common searching engines, and the expectations are high for any searching engine. But, those engines like Google are a result of a decade long developing by thousands of developers. We can't reasonably provide SE to build a similar engine. Askers are supposed to search solutions before posting their question anyway (SO is "the last resort"). If they would do their job properly, they should also find the already existing answers to their question. I'm not saying improvements to the SE searching wouldn't be welcome, maybe within 6 to 8 years we'll finally get some.
    – Teemu
    Commented Dec 14, 2020 at 7:19
  • 4
    The thing is that this is something they are already doing... when you just search for the tag itself: The top (n) tags in the tag list are automatically turned into tags when they appear in searches.. So if you search for "python" it redirects to python, since it is top in the list. This behaviour could well be generalized to match names of top tags in a longer search query.
    – fedorqui
    Commented Dec 14, 2020 at 19:49

1 Answer 1

16

Teemu makes a good point in the comments that automatically interpreting any word as a tag could have more negative consequences than positive, given how many are simple English words.

Perhaps a useful thing for SO search would be a "did you mean" for words that are tag names. Probably only do that if the query didn't include any [tag] filters, or only if the query didn't include any meta operators at all, so is:question or score:1 or whatever would also stop search from trying to be extra helpful.

This would allow beginners to easily discover the tag-search syntax if they missed it in the popup help that appears when you click in the search box at the top of the any page. To be fair, the top left of that help box is:

[tag] search within a tag

with a link to https://meta.stackoverflow.com/help/searching

But if someone didn't read that help while entering a query, they could easily not go back to it and not discover the way to tag-search.

3
  • 2
    Even that help text is only meaningful to experienced users. Commented Dec 14, 2020 at 17:17
  • 1
    @chrylis It seems fairly self-explanatory for anyone's who's heard of the concept of a tag, and a search with meta-characters, which is most programmers(?). For people who find that opaque but want to know what it's about, the link to stackoverflow.com/help/searching explains in more detail. I think the major issue is getting some kind of reminder in front of people's eyes exactly when they're looking for a way to get better search results, not while they're still optimistic that it will be simple. (If people can't be bothered to read help even then, SO may be the wrong place for them) Commented Dec 14, 2020 at 17:35
  • Did you mean would be slightly annoying. Instead maybe "choose between these".
    – 10 Rep
    Commented Dec 15, 2020 at 4:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .