Sunday, February 26, 2012

free text search

does anyone have code that shows how to separate individual words from a sentence.

e.g. i have a list of questions and answers in my database and have the following query for it:

SELECT question, Answer
FROM QuestionsAnswer
WHERE FREETEXT(Question, 'i want to travel around the world and learn about cooking')

so i want to extend the above query so that takes each key word (travel, cooking, learn) to find out how frequently that particular word appears in the question (for ranking purposes).

I know freetexttable does rank results, but they don't seem accurate enough for what i need to do.

HELP!!!i've just been told that freetext does this anyways...

=D|||have u tried search on the web|||You will need:

* A one column list (table) with all unimportant words. For that purpose I used a 20-year-old Commodore 64 text adventure interpreter list.

* A two column list (table) with the important words and the number of total occurences for each word.

You parse your text with space, comma, etc as word seperators and run each word against the first list. If it is not their you search it in the second list. If it is their you increment the occurence counter. If it is not their you add it with an occurence counter=1.

Check your second list from time to time in order to see if you can transfer a word from list 2 to list 1.

Easy, isn't it ?

No comments:

Post a Comment