The "Did you mean" feature

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lucy82m
    New Member
    • Mar 2008
    • 3

    The "Did you mean" feature

    Hello, I want to add the 'did you mean' feature (like on Google) on my shareware site, where a lot of users have mistypes, and they get 0 results... so they exit the site very fast. Do you have any idea how I could implement such a thing? Does it require a dictionary or something? I found some scripts, but none of them gave relevant results... just stupid, irrelevant suggestions. Any help would be appreciated... sample code would be awesome.
    Thanks, Lucy
  • adamalton
    New Member
    • Feb 2007
    • 93

    #2
    That's no easy task! Have you considered just putting a Google search form on your site though? I.e. a form that uses Google to search just within your site. It would be a lot easier!

    Comment

    • coolgames
      New Member
      • Oct 2007
      • 168

      #3
      Originally posted by adamalton
      That's no easy task! Have you considered just putting a Google search form on your site though? I.e. a form that uses Google to search just within your site. It would be a lot easier!
      yes, http://www.google.com/coop/cse/ that will help you (it does require some work do be done) or, you can use scripts that will be hosted right in your website like these:

      Comment

      • aktar
        New Member
        • Jul 2006
        • 105

        #4
        The following functions will be of help to you. Look it up in your php manual

        levenshtein()
        soundex(),
        similar_text(),
        and metaphone().

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Originally posted by aktar
          The following functions will be of help to you. Look it up in your php manual

          levenshtein()
          soundex(),
          similar_text(),
          and metaphone().
          I was actually wondering what else is there besides soundex() , thanks for the quick and dirty list! I might use this for a government app.

          DM

          Comment

          • lucy82m
            New Member
            • Mar 2008
            • 3

            #6
            google custom search is not good for me... i want to display the results in my layout, using some special boxes....

            anyway, am now trying levenstein, soundex, and also yahoo api. thanks.

            Comment

            • Markus
              Recognized Expert Expert
              • Jun 2007
              • 6092

              #7
              Originally posted by aktar
              The following functions will be of help to you. Look it up in your php manual

              levenshtein()
              soundex(),
              similar_text(),
              and metaphone().
              *heads to php.net*

              Thanks aktar!

              Comment

              • lucy82m
                New Member
                • Mar 2008
                • 3

                #8
                OK, the winner is Yahoo Spelling Suggestion (which uses Yahoo API). This gives your site the possibility to suggest exactly what Yahoo Search suggests :cool: Awesome, I would say!

                Here is a short summary about using it, if you guys want to use it too: it requires a Yahoo API key, which can be got free. It is limited to 5000 queries per day, so I suggest caching the suggestion (which I implemented, as my site has more then 5000 searches per day). The page returned by Yahoo needs to be parsed, and see if there is a suggestion given. This is a page that gives a suggestion, this is one that has no suggestion.

                You can see it on my shareware site: link removed by moderator like "enail backup", "rgistry cleaner" or whatever you want. I also implemented a function to make bold italic the words that are different between the search query and the suggestion from Yahoo. ;)

                If you need assistance on implementing this on your site, let me know.

                Thanks, Lucy
                Last edited by ronverdonk; Mar 23 '08, 10:42 AM. Reason: ad url removed

                Comment

                Working...