Search Function

Discussion in 'HTML & Website Design' started by aquasonic, Apr 9, 2007.

  1. #1
    I want to be able to search a single directory on my site... it's very important that it only produces results from the one directory (and it's sub directory's).

    Also, I want to host the entire script on my server... I get very edgy about relying on someone else's server... cause one day they may decide to close, or move stuff... I like to know where everything is!

    Anyone got any ideas on searching single directory (and sub directory's of that directory) script?
     
    aquasonic, Apr 9, 2007 IP
  2. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    depends on what kind of files you have in that directory

    I would

    create a tmp table in mysql or your favourite db. Something along the lines of

    page title, description, url, score

    cycle through the files in your target folder, strip out any html

    do
    $relevence = $relevence+substr_count($file_content, $searchterm);

    insert the details for that page into your temp table. Then when you have gone through all your files

    select * from tmp table where relevance>0 order by relevence desc

    show the results

    drop the temp table

    That enough to get you going in the right direction?
     
    stuw, Apr 9, 2007 IP
  3. nikholas

    nikholas Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i need it too
     
    nikholas, Apr 10, 2007 IP
  4. forumSEO

    forumSEO Guest

    Messages:
    681
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Why not use the google adsense search bar?
     
    forumSEO, Apr 10, 2007 IP
  5. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    does it do single directories? I haven't looked at it
     
    stuw, Apr 10, 2007 IP