Search for PHP
searchforphp.com
searchforphp.com
I add those soonish. I am still sourcing places to crawl and index at this point. That would be an excellent start.
http://www.searchforphp.com/?s=needle+haystack
EDIT - For those who can't get the page to load, here are my results:
* grapheme_strstr
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0) grapheme_strstr — Returns part of haystack string from the first occurrence of needle to the end of haystack.
string grapheme_strstr( string $haystack, string $needle[, bool $before_needle = false] )
* grapheme_stristr
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0) grapheme_stristr — Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack.
string grapheme_stristr( string $haystack, string $needle[, bool $before_needle = false] )
* iconv_strrpos
(PHP 5) iconv_strrpos — Finds the last occurrence of a needle within a haystack
int iconv_strrpos( string $haystack, string $needle[, string $charset = ini_set("iconv.internal_encoding")] )
* iconv_strpos
(PHP 5) iconv_strpos — Finds position of first occurrence of a needle within a haystack
int iconv_strpos( string $haystack, string $needle[, int $offset = 0[, string $charset = ini_set("iconv.internal_encoding")]] )It probably should. Could you let me know what you would be expected it to display? I can then figure out its doing wrong.
http://www.google.com/search?q=site%3Aphp.net+needle+haystac...
Thanks for the feedback!
I'd suggest that when no results are found that a message is displayed to that affect. There is currently no feedback to tell if the system is still loading, broken or has found no results at the moment.
Suggestion: It appears that the searches sometimes stacked up in queue if I typed fast. (i.e. if I typed a long sentence quick the results continued to flash different content many times, playing catch-up. Looked through the JS quick and I see you are trying to prevent this with runningRequest1/2 so maybe it's the short delay in the .fadeTo() after the GET callback. Try moving the runningRequest = false into the fadeTo callback.
Also, .fadeTo() has a default queue of it's own. You could also add .stop() like this:
$('#function').html(data).stop().fadeTo('fast',1);
Otherwise, really cool! I use "site:php.net foobar" most of the time but this would be a great little widget.If it's just you using this, I would say don't give a crap. But if you plan to allow others to use it and it gains a userbase at all you might consider a similar approach for obvious reasons.
Cheers!
I have quite a list of things to improve now.
I would assume that most of us type at a fairly constant rate so maybe check each keystroke to see how long its been since the last one and maybe if 500 ms have passed, then go ahead and fire off some search results.
In searchforphp.com, function names are search-completed alphabetically. Could you sort them by their usage? Such as token frequency in a corpus of actual PHP source code?
Actually I was looking into doing that. I just need to get a large enough corpus to crunch on. I will probably download a few of the larger CMS's and frameworks and do this.
First thoughts:
The site is slow for me.
There's no feedback indicating the system has captured user input.
On my first visit, I immediately started typing random function names into the search box ('strlen', 'htmlentities', 'func_get_args', etc).
I had no idea anything was going on and assumed that my search returned no results.
It's only when I tabbed out for a few moments and tabbed back that I saw the site worked at all.
When I saw the results, though, my reaction was something like "Wow, that's awesome."
The speed is probably due to the site being hammered. Its only a small VPS and probably not coping very well. Thanks for the feedback though!
Turned it off and everything is responsive again.
The result I expected, and which I got as the first result in Google was: http://php.net/manual/en/language.types.type-juggling.php
I will index that and ensure the search results appear as they should.
what storage solution do you use for indexing?
and perhaps i'm getting penalized by the latency since i'm in shanghai, but it seems that the response time is pretty slow.
The indexing is very much a hybrid consisting of sphinx, mysql fulltext, and a custom solution of python and php.
As for the speed, the site is being hammered... since its only on a little VPS its not coping too well at the moment. I am located in Sydney Australia and its a little slow for me at the moment too. Usually its not too bad though.
Will update it soonish!
Will update it soonish!
Can i ask how you are "getting" the data? Are you compiling the data locally (i would assume via scraping/APIs) and putting it in a full text search engine or are you hitting various services for every search (via APIs?) for every search?
love the site -- its simplicity and bareness have a certain charm.
Web Crawler (custom) RSS crawler (custom) Grep/Parsing of various API references and the like. API's of certain services.
Pretty much everything is hosted locally on the machine though.
One of those cases where the way I search for functions is not the way everyone else does. I now have a lot of data to allow me to really improve things. The function relevance is very high on the list now.
In short its on the to do list, but I figured this was enough to get me started.
No blowhard, just a cool service.
Want some work?
richardlauren@me.com