SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    site search advice

    Hi,

    I'm looking for a good search tool to integrate into a site that is able to index pdfs and word documents.

    Does anyone have any recommendations?

    cheers

    Stephen

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $num 50;
    if(isset(
    $_GET["search"])) {
    $q $_GET["search"];
    $q str_replace(" ""+"$q);
    $start time();
    $eng[0]['url'] = "http://www.google.com/search?num=$num&as_q=$q";
    $eng[0]['reg'] = "/<p class=g><a href=(.*?)>(.*?)<\/a>/i";
    $eng[0]['strip'] = "\n"
    $y=0;
    foreach(
    $eng as $c) {
    $text1 join(""file($c['url']));
    if(
    $c['strip']) $text1 ereg_replace($c['strip'], ""$text1);
    preg_match_all($c['reg'], $text1$matches);
    $numr count($matches[0]);
    for(
    $x 0$x $numr$x++) {
    $url strip_tags($matches[1][$x]);
    $title strip_tags($matches[2][$x]);
    print(
    urldecode($url)." ".$title."<br>");
    $y++;
    }
    }
    $secs time() - $start;
    print(
    $y." results returned in  ".$secs." seconds.");

    cheers
    Last edited by reminder; Feb 8, 2005 at 04:16.

  3. #3
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much for this reply. I don't think this is what I am looking for however - I'm after an internal site search, not something that pulls in results from external sites.

    thanks though - I might use this solution elsewhere!

    Stephen


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
  •