views:

1107

answers:

11

Google is unfriendly to searching for verbatim strings with characters like $ and #. Is there a search engine that supports searching for verbatim strings?

I'm aware of this question that was asked a while ago, but didn't get any good answers. I'm ready to put a bounty if I still can't get an answer. Of course it's entirely possible that there isn't one, but I want to be sure :)

EDIT: Quotes don't work. Google strips symbols even when quoted.

Example query: make "$<", for the $< variable in makefiles.

A: 

You can just put the verbatim string you want in quotes in google...

TJMonk15
Doesn't work for what the OP is requesting. For instance, try searching for `">>>"` - you'll get "No results found." even though there are plenty of pages talking about the Javascript binary-shift-right operator.
Amber
Ah. I guess I don't use search for operators... Usually i would look for binary shift operator in that case :-p Though he does say he is not searching code...
TJMonk15
A: 

I find that whilst Google often includes irrelevant topics in search results, they all tend to be similar (e.g. from the same derivation from the input). So if the results are a little 'contaminated', they can usually be fixed with a few well chosen exclude clauses using -.

Joe
This answer has nothing at all to do with the question, aside from being vaguely about google.
Breton
Not sure what point you're trying to make. I was sharing the method I use to answer questions about code based on specific fragments.
Joe
A: 

The open-source search engines have much more flexible indexers than anyone else. If someone else hasn't written a tokenizer that allows for symbols, it's easy to write your own. I'd look at Solr/Lucene, Xapian, Sphinx and Ferret.

Also, no pesky Google AJAX API 64-result limit!

He's not asking for an indexer he can run himself
reinierpost
He's also not not asking for an indexer he can run himself. Alternative solutions are still solutions.
Justin Johnson
+3  A: 

Here is what I use:

www.koders.com - It indexes several open source projects, so, if I want to know how something is done, it just find on the source code what I need. And it works really well.

Kico Lobo
Doesn't answer my question, please read the question and the comments carefully before answering.
static_rtti
Actually, I answered your question :)You asked for a search engine which could support queries like <$ and so on. And the one I showed you does exactly that! :)Actually, and more, because as it is a developer foccused search engine, all the content you'll get is exactly code. The code you need + the comments related to it.Maybe you should try it.
Kico Lobo
I've tried it, I knew about it a lot before actually, but it does not answer my question (read the clarification comments to understand why).
static_rtti
+2  A: 

Have you tried Yahoo BOSS? It's a search API which is currently free (requires sign-up), through which you can use Yahoo's web search. If you escape all relevant characters as described in the FAQ, you can search for arbitrary verbatim strings.

taleinat
That page you link to doesn't say anything of the sort. It just gives a list of characters that need to be escaped when used in a URL in BOSS argument values.
mercator
+11  A: 

The answer, of course, is Google :-) In particular, Google Code Search. See for example the queries for your requests (sorry StackOverflow links are broken with these, you'll have to cut and paste) (edit: fixed the links)

>>> http://www.google.com/codesearch?q=>>>

$ http://www.google.com/codesearch?q=\$

# http://www.google.com/codesearch?q=\%23

EDIT: Ok, from your latest comment to the question, I see your point now. This would be useful to many (for me, just the very few times in my life that I might need it). But, as far as I know, there isn't any way of doing that. If you search the forums for "symbol search" you'll find lot of complains like this.

The closest thing that I've found is this, which is pretty happy to search for symbols (but only withing that relatively small community, which is not what you are looking for): http://perlmonks.org/

Why don't we write such a programmer search engine??

Davide
I want to search the internet just like when using google, mostly for documentation. I'm *not* searching code.
static_rtti
See my comment to your question
Davide
See my comment to the question :)
static_rtti
We could perhaps write such a search engine. Then we'd have to index the Internet, which is a bigger problem. I don't think many of us are going to be able to afford Google-size data centers with Google-level bandwidth, and that's what we'd need to get started.
David Thornley
Surely we don't need their bandwidth, and neither their processing power nor speed. Programmers are a tiny fraction of web users, and for such a service they could happily wait more seconds than on a common Google search. Surely storage can be a problem, but again, if we find a smart way of indexing only "programming-related" pages, than we are set: I believe that a small cluster can handle it pretty easily! Now, developing the right algorithm and the right rank system, that could be hard.
Davide
if only google's engine was open source ...
hasen j
-1, in essence, put up or shut up. Vaporware is not a valid answer.
Breton
A: 

this one would be cool if more was covered.... it doesn't specifically get your answer, but i find it useful

http://start.gotapi.com/

or

http://www.gotapi.com/html for the html version

you can also go here and check out more, obviously

CheeseConQueso
A: 

OK, so let me stick my 2c in and see if I can clear this up. You have, possibly, three searches to make:

  1. What is "$<" ?
  2. How can literal strings such as $foo or <<< be searched?
  3. If I don't know the name of something, and my search engine doesn't let me search for literal strings, how can I search for it?

First case is easy, it's the name of the first prerequisite that a make process needs for the target being built. See http://www.gnu.org/software/make/manual/make.html#Automatic-Variables for example.

Second case is pretty hard. Google say that with very few exceptions, punctuation is ignored (see http://www.google.com/support/websearch/bin/answer.py?answer=134479). So that rules out lots of the little atom-y things you have in code like "++" and "<<". Of course, Google do have to apply some smarts to this, e.g they do permit searching for "C++" as a unit in its own right. Though perhaps the world would be a better place if C++ just disappeared from the Internet :)

Third case belongs somewhere in between librarianship and philosophy. Wittgenstein would no doubt have something pithy to say like "we cannot search for that about which we cannot speak" but pragmatically you have no choice but to think about alternate terms that might describe your element. For example, "atom", "variable", "operator" and suchlike.

Hope that helps!

KingZoingo
+1  A: 

This probably isn't exactly the answer your looking for, but I am really sympathetic to this problem, and the strange aloofness that this question seems to encounter.

In this case, you already have some information about what you're looking for. You're looking for some specific part of some documentation page for make files.

here is the documentation for makefiles http://www.gnu.org/software/make/manual/make.html

Conveniently, the entire documentation is on one giant html page. In firefox, press control+f (command+f on macs), to bring up the search within page widget. In firefox's search field, type the symbol your looking for. It reports 37 matches, which you can look through indvidually.

Sometimes though, the sequence of symbols is idiomatic, and isn't in the documentation for a language. How would an outsider know, for instance that a $ in javascript usually refers to jquery, or prototype, or some other included library?

In this case, there's probably a question on stack overflow somewhere that would explain that. However, searching stackoverflow for a $ symbol doesn't work. You could just ask the question, you'll probably get an answer. (as you did in this case).

I think we should perhaps make a stackoverflow feature request? It's not a general web search, but stackoverflow is uniquely positioned to answer problems like this in a way the general web isn't.

edit: after looking around at meta.stackoverflow.com I found a request for this already exists : http://meta.stackoverflow.com/questions/19870/we-need-to-be-able-to-search-for-punctuation-symbols

It would seem that if you press "ask a question" and write

What does the symbol [symbol] in [language] mean?

in the title, then move your cursor to the body, SO will suggest a bunch of questions that were already asked, that are much better results than using "search". You'll likely find the answer to any symbol related query there. And if you don't, go ahead and post your question. I'm sure there's about 10 overeager nerds that will be eager to tell you that the question has already been asked, and point you to where the duplicate questions are, and only at the cost of a few potential downvotes!

Stack Overflow should really add this feature though. It's ridiculous that it doesn't. Duplicate questions is merely the cost that Stackoverflow will have to accept for not having this feature.

Breton
+3  A: 

Cannot help you, but can at least provide you with a vision (maybe same startup will go an realize it).

Assieme is the research prototype of a dedicated search engines for software documentation. The idea is that searching software documentation is a specialized task, that needs specialized search engines. For example, when searching for APi documentation the engine should also extract valid examples from eg blog posts and show them to us. Et cetera.

For the full paper, please refer to: "Assieme, Finding and Leveraging Implicit References in a Web Search Interface for Programmers"

PS: If you are interest in the latest research on software search, you may take a look at the SUITE workshop series. We're also on twitter :)

Adrian
A: 

The closest I've ever found is Cuil, which with your criteria gets as close as finding exact matches for "make $". Unfortunately they're for get-rich-quick sites. But it is better than Google with terms like C# and C++.

Coder 42