views:

192

answers:

1

Hi folks,

i have the following data in a field, which is being indexed by a Full Text Catalog.

Pamorama City, Los Angeles, California, United States

Simple. (I also have lots of others, but they are working fine).

Now, if the user provides this incorrect, mispelt search word

pamorma city <-- notice the middle 'a' is missing from the 6th character slot

then this data field isn't being returned.

So, can a Sql 2008 FTS on a catalog return words which it THINKS it's close?

this is the sql, btw, if this helps...

SELECT TOP(10) a.Address, AddressSearch.RANK AS TopRank
FROM Addresses a WITH (NOLOCK)
    INNER JOIN CONTAINSTABLE (Addresses, FormattedAddress, 
                             'panorma NEAR city') AS AddressSearch 
        ON a.IdAddress = AddressSearch.[KEY]

If so .. can u also define a weight for 'close' words also? like a 90% match or something? cheers :)

+1  A: 

Maybe you can use the T-SQL functions SOUNDEX and DIFFERENCE?

Jakob Christensen
Hmm.. DIFFERENCE might be a possibility :) I'll try and see if i can get some results of '4'. Hmm... Trying to use the result of a SOUNDEX looks very confusing.
Pure.Krome
Did you get it workin?
Jakob Christensen
I think I ended up spliting each word (delimeted by spaces and/or comma's) and search with an AND in the CONTAINS(..) .. I think :P
Pure.Krome