1 Reply Latest reply on Jan 6, 2007 4:56 PM by kglad

    Search string for most wordmatches in database


      I'm working on a chatbot program and I need to make a search engine in flash. I already have on searchengine that search a string (with the users inputtext in it) and compares it to phrases in a database ( a xml file in this case). But I also need another type of searchengine, since I can't fill a file with all phrases a user might type.

      So the searchengine I need, needs to work like this:
      When the user have typed in his/hers text, the search will compare it to some databaserecords. And find the databaserecord that matches most words from the user text. So if the user types in:
      "I have a terrible headache".

      The search will start seeking and the database maybe looks something like this:
      1. I sick
      2. I happy
      3. I stomageache
      4. I headache
      5. You are sick
      6. you're sick
      7. you headache

      Then it will return record number 4, because it found the word "I" and "headache" there.
      Anyone have some tip on how to achieve this?

      Thanks in advance!