8 ms·
Search for PHP
- techbio 16y agoFast. I wanted to do something like this for code-completion, but with tagclouds. Still do in fact. 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?
- boyter 16y agoThanks! 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.
- cowboyhero 16y agoVery cool and extremely useful. 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."
- boyter 16y agoYes its something I need to fix. Im thinking for the very first search ill display a "loading" image, because after that the results fade out a little when you start searching again. 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!
- epynonymous 16y agothis is simple and much like google.com which i like, no advertisements or wordy introductions, and the main function is bright and center. the ui could use a bit of a makeover, but i think you've got something functional and should keep expanding the functionality before investing time on the ui part since it seems that you're the only developer at the moment. 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.
- boyter 16y agoThanks! UI is not my strength, but thats all I could come up with. 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.
- kingkawn 16y ago10/24/10, 10:05pm EST, took minutes to load page initially.
- groaner 16y agoAm I doing something wrong, or should this query return more results? http://www.searchforphp.com/?s=needle+haystack 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")]] )
- boyter 16y agoHi! It probably should. Could you let me know what you would be expected it to display? I can then figure out its doing wrong.
- groaner 16y agoIt's not fair to compare you to Google, but if you're returning results from php.net, I thought I'd see some of the more higher-profile pages: http://www.google.com/search?q=site%3Aphp.net+needle+haystack http://www.google.com/search?q=site%3Aphp.net+needle+haystac... http://duckduckgo.com/?q=site%3Aphp.net+needle+haystack http://duckduckgo.com/?q=site%3Aphp.net+needle+haystack
- boyter 16y agoLooks like the score isn't calculating as well as I would have expected. I will tweak my relevance algorithms to fix this. Thanks for the feedback!
- boyter 16y agoSorry everyone about the problems with load. It should be somewhat more responsive now. It was down to me leaving KeepAlive on in the httpd.conf for Apache. Turned it off and everything is responsive again.
- pinchyfingers 16y agoThis looks really nice, great job. I like it and I'm going to try and use it over the next couple weeks, I'll let you know how it goes.
- boyter 16y agoThanks! Would really appreciate feedback as I improve things. Im pushing almost daily updates at this point, just need to know if they are useful or not.
- nowarninglabel 16y agoNeat idea, especially to a fellow non-IDE using full-time PHP coder such as myself. That said, I tried the first search that came to mind "cast to string" And didn't really get any useful results. First result was for JSON, and the link from php.net was for stripos. 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 http://php.net/manual/en/language.types.type-juggling.php
- boyter 16y agoAh I know the problem. I actually haven't indexed the whole of the PHP manual. I was just going for MVP. I will index that and ensure the search results appear as they should.
- dbingham 16y agoDon't forget to have it search http://stackoverflow.com http://stackoverflow.com in the various php tags. Also, having it search the various framework site's articles, question sites, documentation, etc would be very useful as well.
- boyter 16y agoThanks! I add those soonish. I am still sourcing places to crawl and index at this point. That would be an excellent start.
- jasonlotito 16y agoNot sure if your indexing my forums, but DevNetwork.net might also be a good resource to index. =)
- philfreo 16y agoBonus points if it ranks by textual relevance + # of upvotes on SO
- boyter 16y agoConsider it in the pipeline. I am adding this as a must to do.
- jayphelps 16y agoNeato! Worked snappy for me. Kudos. 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.
- boyter 16y agoThanks! This is my first real play with jQuery. I have added this to my bug queue and will be fixing it in a few hours. Cheers for the tip!
- jayphelps 16y agoHere's another: you're searching on any keyup which creates lots of overhead. Google's implementation is more complex. It appears they search immediately as you type the first few characters on each keyup/down then if the word goes over a few characters it switches to querying every couple seconds, or until you hit the spacebar. It also seems like they have another timer if you pause after a second or two. 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!
- boyter 16y agoI was looking into this but havent yet been able to make it work smoothly. Since you have raised it I will focus on getting it working. I have quite a list of things to improve now.
- moeffju 16y agoTry using http://code.google.com/p/jquery-debounce/ http://code.google.com/p/jquery-debounce/ - it creates a throttle/debounce function for you, so the submit would only be called at most every X ms, no matter how often the event fires. It's super useful.
- photon_off 16y agoI tried a few queries, and honestly I find Google's Auto Suggest to be of more use when searching for PHP functions.
- boyter 16y agoFair enough. I will be aiming to improve relevance for functions since that seems to be the main feedback. 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.
- photon_off 16y agoAwesome. I'm looking forward to seeing what you come up with.
- abraham 16y agoInclusion of GitHub results would be awesome. They have a search API so it should be fairly easy.
- boyter 16y agoI actually did this with Google code for a while, but removed it due to speed issues. I will have a look at the github api though and see if it is any faster.
- mikeytown2 16y agowhere's the foreach loop? http://php.net/foreach http://php.net/foreach
- boyter 16y agoI haven't actually added control structures yet. I just went with functions. In short its on the to do list, but I figured this was enough to get me started.
- Ancient 16y agoHere's a list of Firefox's Ubiquity to search for PHP functions, etc ... https://wiki.mozilla.org/Labs/Ubiquity/Commands_In_The_Wild#PHP https://wiki.mozilla.org/Labs/Ubiquity/Commands_In_The_Wild#...
- happybuy 16y agoVery nice fade in effect when results are shown - soothing and not too jarring. 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.
- iconfinder 16y agoGreat job!
- ucentric 16y agoNice! No blowhard, just a cool service. Want some work? richardlauren@me.com
- Tomek_ 16y agoHaving it working around PHP's inconsistency in function naming would be great, e.g. if I look for "str_pos" the first result should be "strpos".
- smutticus 16y agoWhy should I use this instead of php.net?
- empire29 16y agovery cool site! 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.
- boyter 16y agoAt the moment through the following, 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.
- 9ec4c12949a4f3 16y agoFound no results for <?=