#61
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: do the


    I was wondering if you could let me see the source for your site, since I would like to do something very similar
    Thanks Em
  2. #62
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: AND search?!?!?


    Paul,
    How did you write your OR based search engine? I also use MySQL but am using PHP to talk to MySQL. I would just like to know the concept behind the scripting, and any detailed MySQL queries used to get that result. Thanks in advance.
  4. #63
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: AND Search


    To do an AN search, you can save the results of each search in a separate array (for ex: if you're searching 2 fields, "site_title" and "site_description", save the resultant qids in separate arrays) and then AND the two arrays of qids. You can easily write your own AND merge of the two arrays.

    Hope this helps..
  6. #64
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    $querywords in the code is misused..?


    Has anyone noticed a strangeness in the code? $body is taken from the table blob field and then

    Code:
    ...
    $filtered = $body;
    ...
      $querywords = ereg_replace(",","",$filtered);
    ...
    filtered through into $querywords.
    $querywords is then placed into the search_table..
    then in the actual textmatching statement
    ("SELECT..") $querywords, which is taken from the table, is matched up against itself in the search_table.

    I think $querywords is supposed to be the input text? it can also be filtered through before processing.
  8. #65
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Execution error


    In some cases, this script will take more time to complete than allowed by the PHP maximum execution time setting. If it does, you will get a "maximum time exceeded" error message. This setting has a default of 30 seconds and can be specified in PHP's config file. Unless you are using a server operating in Safe Mode, then you can manually reset the time in your data loading script to prevent this error by using set_time_limit().

    Try adding the following code to the end of the loading script just before the "j++" statement:
    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    if (! get_cfg_var('safe_mode')) {
    set_time_limit(180);
    }
    </xmp></font></pre><p>
    <!-- Code -->


    This will add another 180 seconds of time after each pass. That should be enough to allow your script to complete.

    Hope this helps,
    Dave
    webdev@metaface.com
  10. #66
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    I don't understand this script at all


    Could someone please put this in a "dummy" format. I don't understand how to implement the script, or where to use it.
  12. #67
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    a simpler search engine - for those who like it the easy way


    as somewhat of a beginner, i found this engine a bit confusing - not to mention the fact that the search_table ended up with close to 10,000 words (all repeats and code)
    <br>
    <br>
    so i did a bit of a search and found dgssearch to be very good - it searches both databases and filesystems, is fast, and is pre-made but easy to hack to suit your needs and learn more:
    <br>
    <a href="http://www.digitalgenesis.com/software/dgssearch.html">http://www.digitalgenesis.com/software/dgssearch.html</a>
    <br>
    <br>
    i am currently running the engine on <a href="http://nohead.com">nohead.com</a> and i have found no problems with it whatsoever.
    <br>
    <br>
    also - the engine is open-source (gpl)
  14. #68
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: I don't understand this script at all


    I heard that. I also dont have a clue as to what to do with this. Hardly qualifies as a complete app. Not every knows as much as you Mr. Programmer.
  16. #69
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    search with score


    Hi, i`m trying to make app that can seacrh for keywords and give back the result in alist with score (according to macth). how can i do that. like in google.com
  18. #70
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: I don't understand this script at all


    I agree with KR. This script and the way it's been presented is very confusing.
    And Mr.Programmer is talking with the jargon that only programmers of his/her level can understand.
    What is the point in that ? They aren't the ones who need help in developing
  20. #71
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Almost working


    I have everything installed, but I am having trouble getting the actual searching to return any results. Is their a place where I can see an actual working script that I can modify.

  22. #72
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    my version


    Nice article... but there is a lot of performance flaws in the scripting i would say..... not to mention errors

    i used:

    <?

    set_time_limit (0);

    $server = mysql_connect ("host", "username", "password");
    mysql_select_db ("table");

    $query = "SELECT description, id FROM data";
    $result = mysql_query ($query);

    while ($row = mysql_fetch_array ($result)) {

    $body = $row['description'];
    $qid = $row['id'];
    $noise_words = file ("noisewords.txt");
    $filtered = $body;

    $filtered = " " . $filtered;

    for ($i=0; $i < sizeof ($noise_words); $i++) {

    $filterword = trim ($noise_words[$i]);
    $filtered = eregi_replace (" $filterword ", " ", $filtered);
    }

    $filtered = trim($filtered);
    $filtered = addslashes($filtered);

    $querywords = str_replace (",","",$filtered);
    $querywords = str_replace (" ",",",$querywords);
    $querywords = str_replace ("?","",$querywords);
    $querywords = str_replace ("(","",$querywords);
    $querywords = str_replace (")","",$querywords);
    $querywords = str_replace (".","",$querywords);
    $querywords = str_replace (",","','",$querywords);
    $querywords = "''" . $querywords . "";

    $eachword = explode (",", $querywords);

    for ($k=0; $k < sizeof ($eachword); $k++) {

    $inputword = "INSERT INTO search_table VALUES (" . $eachword[$k] . ", $qid)";
    mysql_query ($inputword);
    }
    }

    ?>
  24. #73
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: my version


    sorry i also kinda fudged up the thing... didnt realise there were tags :P
  26. #74
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: do the


    Can you send me the source too. The one I'm working on is a little different but the same concept. I want to compare the two. I also can't get find a searh that is straight forward yet. I only have the results page so far. (no graphics yet) www.francisjpurcell.com/phptest3.html Any ideas on a good search code?
  28. #75
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: a simpler search engine - for those who like it the easy way


    tnx for the link, looks promising/simple indeed, tnx!

IMN logo majestic logo threadwatch logo seochat tools logo