Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: simple search engine

  1. #11
    Join Date
    Jun 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    when we will get free please help me. you can mail me at dipika_44@live.com

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

    Default

    Please review that thread and post here to let us know if that is the information you need. What I can offer is the newest version of those search functions. I'll try to get those ready soon. I'm away from my computer at the moment, so please remind me on Tuesday to do this. Just post here, or send me a PM. But until then please look through that other thread and see if what is there will help. What I have now is almost the same, just some slight modifications as I've used the scripts.
    Last edited by djr33; 06-26-2011 at 09:52 PM.
    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

  3. #13
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,413
    Thanks
    101
    Thanked 115 Times in 113 Posts

    Default

    Actually ,user inputs the search statement. then how do I parse input string .
    I was assuming that you had already parsed the script. I would work on that before what attempting I suggested. If I were to help you with the parsing I would need to know more about what you are looking for in a parsed result.

    I would like to agree with djr33 as far as the difficulty of this project. By far the search script was the most complicated thing I have worked on with programming and it integrated most everything I know about scripting. Every time I go back to work updating my search script the task is daunting. I have spent a lot of time rewriting it to be as simple as I can make it with comments throughout and streamlined the code as well. All of that helped tremendously, but the script is quite complicated and spread over 5 different files.
    To choose the lesser of two evils is still to choose evil. My personal site

  4. #14
    Join Date
    Jun 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I followed the link above and this thread was really helpful and finally i was able to develop a query like this:
    SELECT * FROM `page` AS a1 LEFT JOIN `page_tag` AS a2 ON a2.page_id=a1.id LEFT JOIN `tag` AS a3 ON a3.id=a2.tag_id WHERE (( a3.Name like "%events%" and a3.Name like "%news%" ) or a3.Name like "%local%").


    I am getting the answer of the OR part but it is not retriving any value for the AND part.

    Do i need to make any changes.

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

    Default

    There are two completely separate parts to a search engine: 1. the actual MySQL query; 2. the user input.

    The first step is to figure out what your query will look like. The second is to generate a query of that type from the user input. Both are hard.

    Your AND and OR logic seems fine. But it's much harder to parse user input to work like that. To find out how it all works just create a test database and play with it. You'll learn quickly that way.
    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

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

    Default

    There are two completely separate parts to a search engine: 1. the actual MySQL query; 2. the user input.

    The first step is to figure out what your query will look like. The second is to generate a query of that type from the user input. Both are hard.

    Your AND and OR logic seems fine. But it's much harder to parse user input to work like that. To find out how it all works just create a test database and play with it. You'll learn quickly that way.
    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

  7. #17
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,413
    Thanks
    101
    Thanked 115 Times in 113 Posts

    Default

    This part
    Code:
    ( a3.Name like "%events%" and a3.Name like "%news%" )
    if I understand your database structure correctly will never be true unless at least one of your a.3Name fields contains both terms "events" and "news".

    The reason this will never be true in your case is because your a3.Name field will only ever be composed of one category name. Am I correct in assuming that you're using a normalized table?
    To choose the lesser of two evils is still to choose evil. My personal site

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

    Default

    My server was down for a couple days but now I have had a chance to look at the latest version of the search script that I have. I'll post it now in the other thread, so please look there for more information. It may or may not answer your current question, but at least it should help. Also, the script may look busy but that's because I comment every line-- that makes it very easy to understand if you go through it slowly.
    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

  9. The Following User Says Thank You to djr33 For This Useful Post:

    dipika (06-30-2011)

  10. #19
    Join Date
    Jun 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks a lot for your concern. whats the name of the thread

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

    Default

    Last edited by djr33; 06-30-2011 at 07:35 PM.
    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
  •