15

As StackOverflow and most of the others in this collection are sites for technical people, we often search for specific technical terms.

As an example, I was searching for a problem with PHP and the /etc/hosts file.

Unfortunately, when I include "/etc/hosts" in the search here, it strips out the slashes and searches for "etchosts" and finds nothing.

If I replace "/etc/hosts" with just "hosts" I turn up lots of questions and answers that are irrelevant to my problem.

Google search does something similar but with much more fuzzy matching which makes my efforts to filter out the irrelevant search results even more frustrating.

Would it be possible to have an option here to include special characters in the search and not strip them out. I would think that including the "/etc/hosts" in quotation marks would be a nice way to indicate that this is what I want although it could be confusing if I wanted to search for a quotation mark. Escape characters might also be necessary.

I know that it would be more computationally expensive, but would it be possible to search by regular expression ? Often, an error message will include something specific to my setup, such as a hostname, in the middle of it and it would be nice to be able to replace that with ".*" and then match the rest of the error message exactly.

2
  • The usual work around is to use google with the site: modifier. Still voting for this because I think that an improved native search should be implemented eventually. Commented Jun 7, 2010 at 18:09
  • I did try some Google searches as suggested by the no search results page but didn't get any better results. Google seems to return even more results than the native search, but with less relevance to what I actually want. Most of what turned up when searching for "/etc/hosts" was questions about hosting providers so I managed to reduce this by adding "-hosting" to my search. Native search doesn't offer the ability to ignore results with certain words. Maybe time for another suggestion.
    – Ladadadada
    Commented Jun 8, 2010 at 9:49

2 Answers 2

2

If you wrap any terms with special symbols in them in quotes, you'll find that search now handles this, for example you can search for "/etc/hosts"

2

Workaround: Use quotes.

When you search for [php] "etc hosts" and you'll probably get better results. On edit, I see you suggest this, but having tried it I note that it does work.

Yes, the search should be improved -- it would be better to replace the / with a space and quote the result, instead of an empty string. But at least you can get better results if you know the trick.

1
  • 1
    Actually, I hadn't tried either searching for the [php] tag or searching for "etc hosts" with spaces instead of slashes. It seems that a search for "etc hosts" does match "/etc/hosts" in the question which reduced my search results enough to determine that no one had asked my question before. Thanks for the suggestion.
    – Ladadadada
    Commented Jun 8, 2010 at 9:44

You must log in to answer this question.

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