| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
Well, that would understandably be *very* fast for a keyword search.
In fact, if the list of keywords was generated on the fly from the contents of the site, this would approach being useful, and STILL be lightning fast, except that then you would have a few hundred kilobytes of Javascript array literals to download. But, that could be put in a separate Javascript file and cached so it would only be downloaded once... Hell, I wouldn't be suprised if Ruby On Rails has a way to do this in three or four lines of code within a few months. |
|
searchItems[0] = new Array that said if the client/developer is on broadband downloading the site at 50k/sec then 1000 products will only take a few seconds to load. |
|
If I were Google, I'd be nervous of this new technology!
|
|
isnt this what msn has been researching to compete in the search war
|
|
This isn't that uncommon. Most of the time, when you have one of those dinky little search boxes on a web page, they're running a simple javascript.
I put one together for this site...The whole thing still hurts my mind, and I keep expecting it to show up on THIS site...anyway, I wrote a search function in javascript, that allowed the user to search content in any of a couple hundred html pages...HARD CODED html pages, and it would return the most relevant results, based on the keywords associated with the page in the (again) hard coded Javascript search arrays. The whole thing could have been done as a lark with a database and any scripting language, hosted for a song, and a million times better because you could update the content without having to manually update pages. The damn thing was supposed to be for a social index, so people were added and moved and all this junk, all the time. Total nightmare. I tried so damn hard to convince the (neo-luddite) webdesigner to "experiment" with this "SQL" thing, but she refused utterly. Go figure. |
|
is this the best WTF you could come up with today?
|
|
Pretty useless, but at least it's fast. I've seen worse than that
(extremely slow and still pretty useless). Done right, it might even become semi-usefull. |
|
This sort of thing might work well for a small intranet, if it were properly indexed. (This one hardly seems to be!) I wouldn't use something like this if I was dealing with a site that was really huge or changed often. And like quamaretto said above, it would work better if searchItems were stored in a separate file. There's an open-source project called Tipue that I've been using for an internal documentation site at my workplace. It does pretty much what this search engine does, except not as incompetently. Also, I wrote a custom indexing routine for it, even though the Tipue site comes with an indexing tool of its own. Tipue is at http://www.tipue.com/ if anyone wants something like this that actually works. |
Re: The JavaScript Search Engine
2005-11-14 13:53
•
by
mrsticks1982
|
Google probably bought it already ... say for a mere 1 Million Dollars |
|
This is fantastic! The only problem that I see with this is that
the person viewing the website didn't know what they should search for. This is clearly not a WTF on the developer end, but more of user error. Jeesshh. :-) |
Re: The JavaScript Search Engine
2005-11-14 14:05
•
by
Anonymoose
|
Not only did they buy it, they also made it work! Go here, and start typing into the text box. Fantastic. http://www.google.com/webhp?complete=1&hl=en Google Suggest |
Google Suggest actually hits their servers and retrieves an XML document... Every time you type a letter. The fact that they have more servers and bandwidth than God, Allah, and Buddha combined is what accounts for the fluidness of the functionality, because the idea verges close to a WTF, really. |
Re: The JavaScript Search Engine
2005-11-14 14:17
•
by
Satanicpuppy
|
Tipue is good 'ware, but the whole thing is staticly indexed which makes it a pain to keep current. If your hosting is good enough, you can get a script that'll do the indexing for you but if you can have a script on the site that can write to files then there has to be a better way than using a javascript search. They get bulky real quick. |
Re: The JavaScript Search Engine
2005-11-14 14:28
•
by
foxyshadis
|
The source code is the real wtf. How many two-letter variables can you stuff into one file? http://www.google.com/ac.js I remember trying to puzzle out exactly what it did when it first came out, before I just got sick of translating and just reinvented it from scratch. I know what this wtf's problem is, it doesn't return enough pages. Everything should be indexed with every word on their pages. That way when someone searches for their main product, they get every page! Yes! |
|
I don't understand, Satanicpuppy ... you could have preprocessed the SQL queries and the web designer wouldn't even have known about it.
|
|
Why do they need javascript at all? Why not just print everything to the page and tell the user to press Ctrl-F??
Sincerely, Sprio Agnew |
Re: The JavaScript Search Engine
2005-11-14 14:45
•
by
loneprogrammer
|
|
This is actually a fairly useful idea, if the search actually is able to find what you want.
This site: http://perldoc.perl.org/ has a javascript search feature, and it actually finds things, since the search index covers things like every Perl function and module name. If the search comes back with no results, you just click one more button, and it does a Google search with your search terms, so if you are searching for something not in the index, you aren't left hanging. You can even download the entire website as a .tar.gz archive, and the search feature still works, since it never contacts the server! It's also good for offline use. |
|
Not seeing the problem personally. It is a simple keyword search. Assuming that the search engine ONLY works with keywords, it hardly matters if it is client side processed or not. While it MIGHT be a waste of bandwidth, it is fast and efficent for searching the keywords that are registered. If the site uses HTTP compression, the wasted bandwidth like likely negligable and is still probably smaller than the HTML file without the embeeded javascript for searching. We're all spoiled by Google. Not every situation requires that you be able to search for the phrase "rabid gophers in heat" and expect to get plumbing references - sometimes a simple keyword search is enough to cover the basics. True, Google even provides tools for doing site specific searching, sometimes you don't want to flood people with results. (oh, the site searchs I have seen, and how useless they were when all I wanted to do was search titles...) Write to your audience, and I'll bet the site search is a damn good fit for 99% of their visitors, esp. if the site is technical in nature. |
Re: The JavaScript Search Engine
2005-11-14 15:08
•
by
Bustaz Kool
|
Kudos for using "Luddite" and "Webdesigner" to describe the same person. Nice touch! |
Re: The JavaScript Search Engine
2005-11-14 15:12
•
by
Casiotone
|
|
Saving bandwidth is a WTF?
|
Re: The JavaScript Search Engine
2005-11-14 15:12
•
by
Casiotone
|
|
Gah, that was supposed to be quoting this:
|
Re: The JavaScript Search Engine
2005-11-14 15:15
•
by
Anonymoose
|
That reminds me of searching MSDN for... anything. What a friggin' useless piece of crap search engine. I almost always end up back at Google, and enter site:msdn.microsoft.com as a search term. Can't wait for Microsoft to try and compete with Google, on the search front! |
I agree. This sort of thing works well for documentation sites that don't change very often. The Tipue site recommends using their search engine on sites that don't exceed 50 pages. The perldoc site is like that, even though Perl's documentation pages are freakin' huge. It would be nice to have a full-fledged search engine on my company's intranet, but it's overkill for us. Tipue works well enough for my purposes, even if the index is bulky (about 200KB, which isn't so bad over a local network). |
|
Don't tell the guys at thunderstone (aka www.master.com). Webinator is looking pretty lame after this.
|
Not a WTF at all, the file simply went through a compressor/obfuscator that removes all the whitespaces and renames variables to both reduce drastically the file size (can come in handy when you're Google and you might be serving the little javascript thing 50 millions times a day if it ever hits live servers) and make the code slightly harder to reverse engineer. Check Chris Justus' Google Suggest Dissected for an "unobfuscated" version. |
Oh yeah, to answer your question that would be 26+26*36 = or 24336 different variables. And that's only taking in account alphanumerics, i think you can also use characters such as "_", "$", "è" or "µ" to name your variables in Javascript. |
Re: The JavaScript Search Engine
2005-11-14 16:19
•
by
Anonymous
|
|
Why does everyone hate on JavaScript so much here?
|
Re: The JavaScript Search Engine
2005-11-14 16:30
•
by
quamaretto
|
I'm not sure who here does that. In web design, Javascript is the solution to a certain set of problems involving interactivity in web pages. It is also useful as a general high-level scripting and programming language, but only Mozilla and Macromedia and some hobbyists have figured this out. Searching large amounts of data, in the client's web browser, is not really a proper job for Javascript. Part of the reason that so much bad Javascript shows up on the site is because it is written by designers and other relatively uneducated peoples, and somewhat less because the knowledge base (popular books and web sites) is so rampant with misinformation, bad hacks and general crap that even good programmers would have a hard time finding best practices. |
Re: The JavaScript Search Engine
2005-11-14 16:46
•
by
ItsAllGeekToMe
|
Because. It sucks more than anything's ever sucked before. |
Several possibilities... a) It's an extremely cheap clone of an already poor language. b) It grew in an unhealthy way and lacks a proper concept. c) It's used for things it shouldn't be used. d) It's used by people who shouldn't use it. e) Real programmers might actually be forced to use it. |
|
It has it's place.
-Form validation without reloading a age. -ummm.... -ummmmmmmm....... -Form vali...oh wait. Crap. -Dynamic forms. Yes! I knew I had one more! |
Re: The JavaScript Search Engine
2005-11-14 17:10
•
by
Gorm Braaarvig
|
|
I've done this for a year before google suggest. With a single server (bad lines, so latency could be an issue). |
Re: The JavaScript Search Engine
2005-11-14 17:16
•
by
clockwise
|
|
There is no way this is a WTF. This is a quick and nasty solution. But I like it. It's fast, it's on the client side, and it's pretty easy to maintain. Please try a little bit harder Alex.
|
Common Lisp is poor in what respect, again?
It is one of the few languages that do in fact have a formal semantics, so it is among the healthiest languages out there (that does not imply that the implementations are healthy, too).
Yes
Indeed
It isn't actually that bad, it is the browsers that suck. |
Re: The JavaScript Search Engine
2005-11-14 18:03
•
by
Gene Wirchenko
|
What about the user? Some software companies have had the standard of their software being usable on an older system as a counter to bloat. Sincerely, Gene Wirchenko |
Re: The JavaScript Search Engine
2005-11-14 18:09
•
by
Gene Wirchenko
|
Thank you for the tip. Searching Microsoft Websites has not been pleasant for me either.
First, they will have to find their butts with both hands. (That unpleasantness has been really unpleasant.) Sincerely, Gene Wirchenko |
|
Otto, thats called AJAX... google it (heh) so you can realise that the wtf here, is you thinking that ajax is a wtf....
Welcome to 2005.... |
Re: The JavaScript Search Engine
2005-11-14 18:28
•
by
foxyshadis
|
XSLT gives it a good run for its money though. Someone needs to come up with a XSLJScript fusion language that requires constant use of eval() and dynamic:evaluate() (the xslt version) and transitions between the interpreters several layers deep. Use it to build a custom SQL-like database. The top faq for the site would be "in order to use our site, you must increase your browser http time-out".
With http compression there would be almost no difference, in plain text would be about half again the size. Besides which, as stated, google has all the bandwidth in the universe and then some. I just made the point that it looks like a bizarre wtf made by someone who doesn't realize languages accept for than two letters per variable (yes, I know full well it was intentionally obfuscated). masklinn: Javascript is case-sensitive. ie, 52+52*62. (I leave gathering a list of all legal characters as an exercise to the reader.) |
Re: The JavaScript Search Engine
2005-11-14 18:30
•
by
foxyshadis
|
The real magic of AJAX is that it lets people like you build a framework to hit the server with a XML request and recieve one back everytime the mouse moves. |
Which reminds me that the local host of "Who Wants to be a Millionare" is always referring to "ninmsn search" if he gets the idea that a phone-a-friend was searching the internet. I'm waiting for someone to tell him that he'd be glad to, if he gave them 30 minutes to come up with something! |
|
I have actually been guilty of creating this kind of search engine :(
|
ammoQ: a) It's an extremely cheap clone of an already poor language. Which language would that be, then? Anonymoose: searching MSDN for... anything. What a friggin' useless piece of crap search engine. That's been my consistent experience also. |
And why would i do that, i currently use Ajax only on some combobox in the intranet web page where i work... useful to update info on the page without having an anoying pageload... Tell me, why on earth would i use ajax for mouse move events? And do you know me or anything..... Have a look at telerik's website, they have some pretty nice asp.net controls using Ajax (www.telerik.net) which dont actually query the server on every mouse move.... Thanks for being an ass |
Re: The JavaScript Search Engine
2005-11-14 22:34
•
by
Jason Kester
|
Tell me, why on earth would i use ajax for mouse move events? check out http://www.ktracker.com for an application that does exactly that. It's a usability tool that lets you watch visitors using your site by actually replaying their sessions. Jason |
Well, I did do something similar here: http://ghostrecon.tacticalnet.org/search.html Except that it does not use arrays for searching but and XML file. Oh and IE only, sorry about that... And the normal View Source isn't going to make too much sense. Drak |
|
But does it support regular expressions?
|
JavaScript a clone of ((common) (lisp))? (((Hard) to) (believe) - (((something) (is)) missing)) ;-)
Having formal semantics is enough to qualify as "healthy"? That's so sad... |
If you mean the original WTF: yes, because it does NOT save bandwidth - quite the opposite, in fact. All the keywords and stuff are transmitted every time the page is loaded, making it considerably bigger than it would otherwise be - and the search feature will probably not be used upwards of 95% of the time. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |