SQL Server - Percentage Full Text Search

I want to search a specific column in a table so that the returned result set must satisfy the following two conditions:

  • The returned result set must contain records, 90% of the characters match the specified search text.

  • The returned result set must have entries, 70% of consecutive characters match the specified search text.

This means that when searching for the 10-character word Sukhminder:

he must return records such as Sukhmindy, Ukhminder, Sukhmindr, because he fulfills both of the above conditions.

But he should not return records such as Sukhmixder, because he does not fulfill the second condition. Similarly, it should not return a Sukhminzzz entry because it does not fulfill the first condition.

I am trying to use the SQL Server full-text search feature. But so far it has not been possible to formulate the required request. Please reply as soon as possible.

+4
source share
2 answers

You can try using a combination of SOUNDEX and DIFFERENCE with full text search.

Check out this google book that talks about it

+1
source

Do you mean 70% of the original word? I think the only way to do this exactly as stated is to work out all possible line permutations that can meet 70% of the criteria and return records matching any of these

Col LIKE '%min%' AND ( Col LIKE '%Sukhmin%' OR Col LIKE '%ukhmind%' OR Col LIKE '%khminde%' OR Col LIKE '%hminder%' ) 

then do further processing to see if 90% of the criteria are met.

Edit: Actually, you can find this link in the Fuzzy Search interesting http://anastasiosyal.com/archive/2009/01/11/18.aspx p>

0
source

Source: https://habr.com/ru/post/1309521/


All Articles