mytwocents All American 20654 Posts user info edit post |
Let's say I want to have a site search...what are my options?
I know that if I have a database I can query it that way....but let's say I don't have one....
Is my only way of doing this by using something like the Google one you can put on your site? Doesn't this mean that I have to wait for Google to index my pages before the search will even work?
Is there some php or cgi script that I could use? 2/19/2008 1:54:37 PM |
quagmire02 All American 44225 Posts user info edit post |
go with google...it's easier and more efficient 2/19/2008 1:58:19 PM |
DirtyMonkey All American 4269 Posts user info edit post |
^ agreed. you can search a particular site only by putting site:yoursitename.com in the search along with whatever keywords you want.
this is handy: https://www.google.com/webmasters/tools. the "site map" section may prove to be more useful to you if you are concerned with google indexing your pages.
[Edited on February 19, 2008 at 2:08 PM. Reason : .] 2/19/2008 2:08:35 PM |
mytwocents All American 20654 Posts user info edit post |
Yeah, but then I have to have the google logo and search option right?
Is it even possible to have a search any other way besides querying a database? 2/19/2008 2:09:19 PM |
Prospero All American 11662 Posts user info edit post |
no.
this is an example of a custom search page: http://search.syprus.com/ 2/19/2008 2:15:23 PM |
DirtyMonkey All American 4269 Posts user info edit post |
my first thought would be to use grep, which is a unix command for finding text in files. this script looks promising if your site supports php: http://programmabilities.com/php/?id=2 2/19/2008 2:17:19 PM |
robster All American 3545 Posts user info edit post |
you actually can ... You can parse the results of a google search for the topic a user searches for (all on the backend using php), and then display them for the user in any way you would like to.
Yahoo and google both have a search API, which you can use in a variety of ways.
BUT ... you might as well just do it the easy way with google custom search, as shown above ^^
[Edited on February 19, 2008 at 4:29 PM. Reason : .] 2/19/2008 4:27:26 PM |
Noen All American 31346 Posts user info edit post |
I wrote a search engine based on bSearch a long time ago. Took about 4 hours of work, but then it was very heavy PHP involved, which I'm pretty sure is beyond your scope. No database needed, it used flat-file XML generation. Not the fastest thing in the world, but it was ridiculously good.
[Edited on February 19, 2008 at 5:43 PM. Reason : .] 2/19/2008 5:43:22 PM |
quagmire02 All American 44225 Posts user info edit post |
meh, i use google search engine to search my sites, but in the search box, in faded gray letters, i put "search provided by google" or something like that...google does it better than i could on my own, and it takes all of 5 minutes to set up 2/19/2008 6:21:21 PM |
mytwocents All American 20654 Posts user info edit post |
well I somehow managed to get the database to work...ish....but just in case, that google search on the syprus.com site, that doesn't do a site search, it's just doing a websearch right? Cause that wouldn't help....
But ^^^^ well it's (the results) are a little messy and a little bit too detailed so I don't think that it will work for the specific purpose in this case but that's an awesome bit of code there so thank you! Always love finding easy cool shit like that
^^hah, pretty much everything is beyond my scope when dealing with this kinda stuff....
^do you just use the regular google site search to search your own site or something else? I have the google site search on my website and it works fine because really, the info searched for isn't a matter of life or death but if you know some better way rather than the plain old generic one they offer, lnk plz? 2/19/2008 7:46:41 PM |
Rat Suspended 5724 Posts user info edit post |
I've actually done a hefty amount of search development in my days.
Since you don't want to query a database though I guess I can't help. But it's hella fast and very efficient. There's pretty simple templates to use if you're into web design and feel like going the extra mile...
just my2(maybe3) cents. 2/19/2008 8:01:07 PM |
jcstille Veteran 254 Posts user info edit post |
I will give my insight into search development. I have written one full system and one that was a feature of a fairly large online retailer. You can look at Omnifind Yahoo Edition. This creates it's own database. It has a very nice search API, and the edition is free up to 50,000 documents. There are some built in search pages, or you can parse the XML yourself. Secondly there is lucene. Pretty easy to use, fast, etc... but unless you use nutch (or something like that) there is no direct web services API.
I personally like the omnifind approach if you can install things on the server. Lucene is just a few libraries.
Although this is heavier tech than you might be into.
John 2/19/2008 8:30:16 PM |
quagmire02 All American 44225 Posts user info edit post |
to use the google search for your site (not as a web search on your site, but to actually search JUST your site) use code like this:
<form method="get" action="http://www.google.com/search"> <input type="text" name="q" size="29" maxlength="255" value=" search provided by Google" onFocus="if (this.value==this.defaultValue){this.value='';}" onBlur="if((1)&&(this.value=='')){this.value=this.defaultValue;}" /> <input type="hidden" name="sitesearch" value="www.yoursite.com" checked /> <input type="submit" value="Search" style="cursor:pointer;" /> </form>
the javascripting is simply there to remove the text when you click in the box for the first time
[Edited on February 19, 2008 at 8:52 PM. Reason : .] 2/19/2008 8:52:09 PM |
roadkill Veteran 142 Posts user info edit post |
In your JavaScript: if((1)&&(this.value==''))
What is the if((1)) for? 2/20/2008 11:02:39 AM |