Related Searches

Discussion in 'Programming' started by xtreme fever, Jul 31, 2009.

  1. #1
    Hello,

    I am researching on how to display related searches when a user searches for a keyword.

    When someone searches for google, I would like related searches for google, such as yahoo, bing, aol etc...

    I am not sure the best way to compile this data or how other sites compile this data.

    Thanks for any help.
     
    xtreme fever, Jul 31, 2009 IP
  2. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #2
    you need to log search results and user-clicks for each search. related searches, as of my thought, is - "People, in general, also searched x, y, z when they searched for a". Here x, y, z is related search, when searched for a.

    I hope, you got my point. This is easy to understand, but hard to implement. You need to apply lot of Data Mining techniques and OLAPs on your data, to figure out the best matches for related search.
     
    techbongo, Jul 31, 2009 IP
  3. xtreme fever

    xtreme fever Active Member

    Messages:
    472
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    95
    #3
    Now I'm trying to set up a simple PHP script and MySQL database for this but I have not come up with the solution yet. Even if I have to enter the data manually, that's fine. I would like to start out simple and display up to 10 related keywords.
     
    xtreme fever, Aug 1, 2009 IP
  4. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #4
    I was on the train today, when I discovered some more clue. Infact last night I spent 2-3 hours finding out what can be done in this issue.

    I'm giving a very basic coding idea of what I wrote in last post.

    create a table in database, with 3 columns. userIp, searchTag, time
    create another table with 2 columns. mainSearchTag, relatedTag

    now, when a search action is initiated, beside the basic searching operation, you have to write code for populating your databse with related keywords.

    write a function to generate related keywords which does the following:
    insert each search tag, ip address of user and time of searching (server date-time) into first table.
    then search, if any user ip in first table matches, with this newly inserted one or not. If a match found, check whether the searchTime in these 2 rows are lesser than some 5 mins or not. If lesser, fetch the searchTag from the 2 matching rows and put them in 2nd table. nb: the newly inserted searchTag will be a relatedTag and the other one will be a mainSearchTag in the 2nd table.

    now write a function to fetch related keywords for current search:
    find the current search term in the 2nd table. probably after some 100-200 ad-hoc testing, you'll start getting matches. now order the matching rows by number of occurance.
    Like: For a search term 'hospital', if 10 matching rows found in the 2nd table, among which 4 pairs were (mainSearchTag:hospital; relatedTag:doctor), 3 pairs were (mainSearchTag:hospital; relatedTag:medicine), 2 pairs were (mainSearchTag:hospital; relatedTag:clinic) and 1 pairs were (mainSearchTag:hospital; relatedTag:ambulance), then you can display the related tags in this order:

    Related Search For Hospital
    Doctor | Medicine | Clinic | Ambulance

    If you're good in php-mysql programming, you can do it. I guess, you got the clue.
     
    techbongo, Aug 1, 2009 IP
  5. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #5
    I personally believe that, search engines like Google would remain worthless, if millions of users stopped searching using Google. Because, Google can itself harvest pages and store them for future use. But the large numbers of queries, generated by human, from different location/economy/niche makes possible to generate patterns of data, patterns of searching behaviours etc. Google generates Related Search Tags, only on the basis of: how past users searched this term, and what terms were always searched, when this term was searched.
     
    techbongo, Aug 1, 2009 IP
  6. xtreme fever

    xtreme fever Active Member

    Messages:
    472
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    95
    #6
    Thanks. I will have to invest more time and resources when I get ready for this project.
     
    xtreme fever, Aug 3, 2009 IP