Results 1 to 9 of 9

Thread: Search Engine Code?

  1. #1
    Join Date
    Aug 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Search Engine Code?

    I am looking to create an information CD and I would like to have a search engine on it so that a word could be inputted and the corresponding files would be listed that match that word. Is there any search engine code out there that does not rely on the web? The CD will be in html like a web page.

    Any help is appreciated,
    Thanks,
    Sabis

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'm afraid that's not possible. It could be done with server-side code, but without a server, that option's not available to you.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    I remeber seeing a method once where a desktop program produced an XML index of all the files, and provided some javascript to search the index. I can't see to find the link, but this could be one of the few times something like that could be useful.

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Maybe, but I think Twey is right-er on this one
    - Mike

  5. #5
    Join Date
    Aug 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well i dont know if this would work,
    but the only thing i could see you doing is making a search type of thing for around your website.
    but i know little how that is done.

  6. #6
    Join Date
    Aug 2006
    Location
    Hertford, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    There is a script that does act like a search engine.
    If.... you don't mind typing in all the keywords that each file relates to, ie:
    javascript.htm :: java, script, javascript, scripts, dynamic
    html.htm :: html, htm, hyperlink, text etc, etc
    If that's OK with you....
    You can see the structure where you add the page url and then a header description following it. You then enter keywords/keyword phrases. The secret is not adding too many keywords to each line.
    The automatically generated page created when the person clicks the generated button will show a list of relevant pages/files (as would Google). It also has a points score out of 10 showing the highest number being the most relevant.
    I've added random page names and random keywords to suit as I've used this script on a number of websites but it will work off-line which is what you want. You will of course, need to craete html documents named as they are named in the code below but obviously altered to what you want.
    Just create a basic web page and insert the first lot of code into the HEAD.
    Here's the code:

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin

    var item = new Array();



    /* Enter additional pages

    fill in the additional listings for each page.

    */



    // "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"



    c=0; item[c]=new Array("OurServices.html","","Our Services","services,our services,fencing,consultation,brickwork,planting,plan,plans,patio,patios,paving,turfing,decking,driveways,pergolas,lighting,water features,fountains,waterfalls,paths,garden clearance,garden,gardens,maintenance","An overview of the services we at Oakwood Landscapes provide.");

    c++; item[c]=new Array("GardenDesign.htm","","Garden Design - The Design Process","garden design,landscape design,design,design process,designing,process,visit,site visit,home visit,consultation,outline,master,layout,planting,plan,project monitoring,customer feedback,feedback","Our Garden Design page illustrates the actual design process from the initial first contact through consultation, planning, design, construction, planting, right up to aftercare.");

    c++; item[c]=new Array("Landscaping.htm","","Landscaping","landscaping,landscape construction,soft,hard,soft landscaping,hard landscaping,design and build,design & build,grounds maintenance,show home gardens,showhome gardens,semi-mature shrubs,semi-mature trees,shrubs,trees,semi mature,semi-mature,stone,wood,brick,buildings,garden buildings","The range of services we provide within our Landscaping section.");

    c++; item[c]=new Array("Planting.htm","","Planting","planting,plants,semi-mature plants,semi-mature,semi mature,mature,plants,flowers,trees,shrubs","A brief description of our Planting once your garden has been designed and built.");

    c++; item[c]=new Array("Aftercare.htm","","Our Aftercare Service","aftercare,after care,maintenance,consultants,consultancy,garden management,weed control,development.","Garden Maintenance and our Aftercare Services.");

    c++; item[c]=new Array("Consultation.htm","","Our Consultancy Service","consultant,consultancy,consultantsy,consultation,meeting,home visit,home visits,planning,consultancy service.","Whether we are building and/or planting your garden or not, we provide consultancy service based on an hourly rate. This can be a one-off visit or a series of visits over months or even years.");

    c++; item[c]=new Array("RacingFixtures.htm","","UK Racing Fixtures 2004","flat meetings,mh meetings,racing,horse racing,horse racing events,racing events,ascot,aintree,newmarket,stratford on avon,stratford upon avon,epsom,epsom downs,goodwood,sandown park,doncaster,haydock park,redcar,york","Racing Fixtures throughout the UK 2004 with Flat Meetings and MH Meetings all listed by region and dates.");

    c++; item[c]=new Array("findingconferencevenue.htm","","Finding a Conference Venue","events in january,events in february,events in march,events in april,events in may,events in june,events in july,events in august,events in september,events in october,events in november,events in december,events in 2004,corporate days out,venue dates,event dates,football,rugby,rugby union,concerts,bands","Our UK Events Calendar 2004 contains everything from football, rugby and rugby union matches to bands, live music and concerts. You can search for your ideal venue by location and date.");

    c++; item[c]=new Array("contact.htm","","Contact Your Company","email,e-mail,email your company,e-mail your company,address,postal address,jester events address,telephone,tel,phone,contact,contact jester events,fax,fax number,telephone number","Please use this page to contact us by post, phone, fax, email or by completing the form.");

    page="<html><head><title>Search Results</title></head><body bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";

    function search(frm) {

    win = window.open("","","");

    win.document.write(page);

    txt = frm.srchval.value.split(" ");

    fnd = new Array(); total=0;

    for (i = 0; i < item.length; i++) {

    fnd[i] = 0; order = new Array(0, 4, 2, 3);

    for (j = 0; j < order.length; j++)

    for (k = 0; k < txt.length; k++)

    if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")

    fnd[i] += (j+1);

    }

    for (i = 0; i < fnd.length; i++) {

    n = 0; w = -1;

    for (j = 0;j < fnd.length; j++)

    if (fnd[j] > n) { n = fnd[j]; w = j; };

    if (w > -1) total += show(w, win, n);

    fnd[w] = 0;

    }

    win.document.write("</table><br>Total found: "+total+"<br></body></html>");

    win.document.close();

    }

    function show(which,wind,num) {

    link = item[which][1] + item[which][0];

    line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";

    line += item[which][4] + "<br>"+link+"</td></tr>";

    wind.document.write(line);

    return 1;

    }

    // End -->

    </script>

    ---------------------------------------------------------------------

    Then insert this code into the BODY:

    <hr>

    <font color="#FFFFFF" size="2" face="Geneva, Arial, Helvetica, san-serif">Simply

    type in a keyword or keywords relevant to what you are searching for and click

    search <br>

    On the 'Results Page' - The higher the score, the higher the relevancy to your

    search<br>

    <b>Please use lowercase only, NO capitals in the search box below</b></font></div>

    <form method=get action="javascript:void(0)" onsubmit="search(this); return false;">

    <tr>

    <td align="left">

    <div align="left">

    <input type=text name=srchval value="">

    <input type=submit value="Search this CD using keywords or phrases">

    </div>

    </td>

    </tr>

    </form>

  7. #7
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Javascript Kits has one(http://www.javascriptkit.com/script/...se/index.shtml) that is opensource. Here is a commercial solution aimed at Info CDs(Imagine that )

  8. #8
    Join Date
    Aug 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I seem to remember a search engine prog that would build what you are loking for.

    Try a search for searchenginebuilder Iseem to remember it was from aleadsoft.com.

    John

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You'd be much better off writing a program for this, than using a webpage.
    If you must use a webpage, something above might work, or I'd just suggest running it through a server to check. As long as the server is and will be running, that is.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •