Forum Moderators: coopster & phranque

Message Too Old, No Replies

SQL Question

         

em00guy

11:46 pm on Jan 16, 2002 (gmt 0)



How do I build a query that will search a db for a record that dosen't mach the search criteria 100%.

Exapmple. How can I make the app find the word "academic" when someone searches for "akademic"

Thanks

txbakers

3:49 am on Jan 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is nothing that will search for misspelled words, but you can search on parts of words using javascript before you build the SQL statement.

You could substring out the first 2 chracters and use the SQL "LIKE" command to find words that start the same.

But if you are looking for academic, and type akademix, you will get nothing.

amoore

4:46 am on Jan 17, 2002 (gmt 0)

10+ Year Member



If I had to do that, I would run the input through ispell (or actually use the Text::Ispell perl module on it) before I passed it to my database. You run the risk of incorrectly "fixing" some words, but that's a chance you run.

gethan

9:32 am on Jan 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd run the query with the raw query and if no results are found then run through ispell as amoore suggests (though I've been told aspell is better).

See most search engines ... Results for "search engine optimisation" did you mean "search engine optimization" ;)

ralnikov

10:45 am on Jan 17, 2002 (gmt 0)

10+ Year Member



If you're using MS SQL try to use soundex and difference. But better way is to create COM that handles it.

em00guy

9:16 pm on Jan 18, 2002 (gmt 0)



I'm working with asp and acsess so it looks like i may be out of luck. Thanx for your help.

KodeKrash

10:48 pm on Jan 18, 2002 (gmt 0)

10+ Year Member



SoundEx and Metaphone algorithms are available in ASP. If you have a word file, you can simply query it based on the SoundEx or Metaphone form of the query term(s), get a list of words that are like your query term(s), then query your database for those words.