Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9

Thread: Site Search

  1. #1
    Member
    Join Date
    Apr 2004
    Location
    UK
    Posts
    46
    Member #
    5821
    Hi,

    Not too sure if this is the best place to post this thread, but here goes...

    I have created a website that includes a search box (basic input field with submit button). However, as i don't know anything about back-end programming, i was wondering what is the best (free) option to use to execute and display the search results?

    I definitely don't want to use my own database or server-side scripts. I have seen some sites that use google - but the problem is that the results are displayed IN google - and not in the original site's design and layout.

    What free options can i use to make the search box work on a particular site? I have also heard of Atomz (?) - is that any good? Free?

    Any help and advice here would be great. Thanks for your time!

    min8
    www.minimal8.co.uk - minimalist in style

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    I guess you mean a third party search engine that keeps track of your site. (you can also perform external searches from it)

    The below is free, and you can make the results appear within a template of your choice (so that it looks like the results are presented within your own domain).
    You can easily tell the search engine what pages to index, and wich ones to drop.

    The free version comes with some ads. The ads are displayed as a few links above your returned search result. They're not really invasive.
    (However, if you want an ad-free version, you will have to pay. Lowest price starts at USD 19 pr/mth.)

    Their online manual tells you everything you need to know to get started.

    http://www.freefind.com/
    S. Rosland

  4. #3
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    Also try Atomz (http://atomz.com ) and PicoSearch ( http://www.picosearch.com/ ). Google can also be added to your website. See http://www.google.com/searchcode.html .

    If you need more help, post back.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    From The GAME'S Dark Horse Engine of 2004:

    http://www.gigablast.com/free.html

    Their relevancy algo is, IMHO, superior to those of the major competitors, which is the primary aspect of the engine.

    I'm not sure how this works though since I've never seen it implemented on a site.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Member
    Join Date
    Apr 2004
    Location
    UK
    Posts
    46
    Member #
    5821
    i'll have a look!

    Thanks guys for the replies and advice (and links).

    I'll take a look and see how it goes - any problems, i'll get back here!

    Cheers,

    min8
    www.minimal8.co.uk - minimalist in style

  7. #6
    Member
    Join Date
    Apr 2004
    Location
    UK
    Posts
    46
    Member #
    5821
    freefind

    Quote Originally Posted by rosland
    I guess you mean a third party search engine that keeps track of your site. (you can also perform external searches from it)

    The below is free, and you can make the results appear within a template of your choice (so that it looks like the results are presented within your own domain).
    You can easily tell the search engine what pages to index, and wich ones to drop.

    The free version comes with some ads. The ads are displayed as a few links above your returned search result. They're not really invasive.
    (However, if you want an ad-free version, you will have to pay. Lowest price starts at USD 19 pr/mth.)

    Their online manual tells you everything you need to know to get started.

    http://www.freefind.com/

    Hi,

    Gave freefind a try and i guess it works. However, the thing about these third party search engines, this one and others (judging from what i've seen on the web), are that the custimisation for the results page is very limited.

    Even with the same colours and logos, it is still obvious that the user is jumping to a different site.

    Does anyone have an actual script (php or otherwise) to use for the action of the submit button??

    Anyways, thanks for the link nonetheless!

    min8
    www.minimal8.co.uk - minimalist in style

  8. #7
    Junior Member
    Join Date
    Oct 2004
    Posts
    10
    Member #
    7768
    A while back, a friend of mine wanted a search box to search the pages on just his site. He tried a bunch of the free options and didn't like any of them. Some took too long to search, or load and some displayed the results in a manner that was inconsistent with his site. He asked if I could write him a script to get the job done.

    I know at the beginning of this thread, you mentioned you didn't want to use server-side scripts, but I figured I'd put this here in case you or anyone else could use a rough starting point if they wanted to go the perl route.

    Code:
    #!/usr/bin/perl
    
    use strict;
    
    my $searchfor = $vars{searchfor};
    my $bin = "cgi-bin";
    my @dirs = ();
    my @found = ();
    my @files = glob("../*");
    
    foreach my $one (@files)
            {
            if (-d $one)
                    {
                    if ($one =~ /$bin/i) { next; }
                    push(@dirs, $one);
                    }
                  else
                    {
                    open(IN, "$one");
                    my $file = <IN>;
                    close(IN);
                    if ($file =~ /$searchfor/i) { push(@found, $one); }
                    }
            }
    
    while (@dirs)
            {
            my $dir = shift(@dirs);
            my @files = glob("$dir/*");
    
            foreach my $one (@files)
                    {
                    if (-d $one)
                            {
                            if ($one =~ /$bin/i) { next; }
                            push(@dirs, $one);
                            }
                          else
                            {
                            open(IN, "$one");
                            my $file = <IN>;
                            close(IN);
                            if ($file =~ /$searchfor/i) { push(@found, $one); }
                            }
                    }
            }
    
    print "content-type: text/html\n\n";
    foreach my $one (@found)
            {
            print "$one<br>\n";
            }
    This search tool doesn't require a database. It simply scans each page it finds on your site for the keyword to search for. It will automatically hit every subdirectory except for the cgi-bin.
    It is not a perfect script but does show you it's not that hard to have your own site searcher that you can customize to look and act any way you want. If anyone decides to try and use this script, please note a few things: It won't work with directory names that contain spaces and it will scan every file including binary files to try and find the keyword. The site this script was designed for was pretty much all txt and html files so we didn't have to make a robust engine. The site contained about 1200 files and the search times were fast.

  9. #8
    Member
    Join Date
    Apr 2004
    Location
    UK
    Posts
    46
    Member #
    5821
    Looks good!

    Hi,

    Thanks for the last post jerome - i've got a funny feeling it's something i've wanted (hopefully!). As mentioned earlier, i'm currently using the one provided by freefind, and so far, it's OK... Search results can be hit and miss and the customisation for the display webpage is a little limiting.

    So i might give your wee script a try. Do I save all the code on a separate file? Is it a cgi script (i.e. end file extension?)? Where do i upload it on the server (i.e. would i have to upload it on a perl folder? cgi-bin???)?

    Apologies for the questions! Thanks again.

    min8
    www.minimal8.co.uk - minimalist in style

  10. #9
    Junior Member
    Join Date
    Oct 2004
    Posts
    10
    Member #
    7768
    Things can get a little complicated if you're new to this cgi stuff. Many web-hosts do not allow you to put executable scripts into just any directory. They usually will specify somewhere on the site what the name of the directory needs to be. More often than not, the directory will be either "cgi-bin" or "cgi".

    If this cgi directory is not already in your directory structure, you'll have to add it yourself. Add it in your root directory. Save the above code into a separate file named "search". Most of the hosts I've used don't require a specific extension for the filename, but again, check with the support system of your host to see what's required. If they do require a particular extension, it will most likely be ".cgi" or ".pl".

    When you upload it to your server, you need to make certain you upload it using ASCII mode and not binary mode. Even if your uploading software has an "automatically detect" setting, don't use it, force it into ASCII mode for this file. Once uploaded you will need to change the permissions for the file so your users can execute the script. If you are using a unix/linux host, do a chmod on the file and set it to 755. Unfortunately, I've never used a Windows host, so maybe someone else can offer up setting the permissions on a Windows host.

    When you build your HTML page, your form will then look something like this:
    Code:
    <form action="/cgi-bin/search" method="post">
    <input type="text" name="searchfor">
    <input type="submit" value="Search">
    </form>
    The action parameter points directly to the search file you saved earlier. You've got a full range of options to work with when you create your own search engine. For instance, you can tinker with the search engine to search only specific directories or certain filetypes. You can make it skip binary files or only search through .txt files. You can also make the results look anyway you want, it just takes some time.

    The worst part about this whole thing though is that it's highly unlikely that you'll be able to just dump this script onto your site and have it work properly. If you're really serious about using this on your site, feel free to send me a private message and I can walk you through making it work. Be prepared, it'll take more than just an hours worth of work to get it done, but you will have a customized search engine explicitly designed for your site.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:25 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com