Skip to main content
November 4, 2011
Question

Find Similar String

  • November 4, 2011
  • 1 reply
  • 1182 views

Hi,

    I encounter a problem on searching similar string. Now, I have a list of company list and allow user to add / modify the company information. But, when user adds a new company, they may input duplicated company name.

    E.g. the company name is "The ABC Company Ltd.". User may input a new company name "The ABCD Company Ltd." or "ABC Company Ltd." or "The ABC Company Limited.".

    In fact, user want to find "The ABC Company Ltd.". Therefore, is there any method of search similar string? At least, the system can search the similar string and request user to confim the new company name before adding it.

    As I know, there is a method using SQL soundex. But, can it find out most of the similar cases? Or, is there any other methods to do it?

This topic has been closed for replies.

1 reply

Inspiring
November 8, 2011

The technique you are asking about is usually called "fuzzy search" or "fuzzy lookup".  There are two ways you might approach this problem.

1. Use the Solr search engine bundled with CF (which supports fuzzy search) and the CFSEARCH tag.  Note that you should not use the Verity search engine, since feature will be removed in the next version of CF.

2. If you are querying a database you might use the fuzzy search capabilities, if any, supported by your database product.

Questions:

1. What kinds data source(s) are you trying to search: a database, flat file, LDAP, other?

2. If querying a database, what product and version are you using?

3. What version of ColdFusion are you using (version number and edition)?

References:

"Solr search examples"

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS82937B1B-240F-4850-B376-5FD9F911E5E5.html

"CFSEARCH"

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d02.html

"ColdFusion X Writeup" (discusses removal of Verity from future CF releases)

http://www.coldfusionjedi.com/index.cfm/2011/3/3/ColdFusion-X-Writeup

November 9, 2011

Data is in SQL Server 2005 database.

And ColdFusion version is 8.0

Since I have a list more than 100 company name, I want to find some efficient method to search the similar string.

Inspiring
November 9, 2011

You may might be able to use the full-text search features of MS SQL 2005 in your SQL queries.  ColdFusion 8 includes the Verity search engine.  You might investigate this feature.

References:

SQL Server

"Full-Text Search Queries" (MSDN)

http://msdn.microsoft.com/en-us/library/ms142583%28v=SQL.90%29.aspx

"Searching for Words or Phrases Close to Another Word or Phrase (Proximity Term)" (MSDN)

http://msdn.microsoft.com/en-US/library/ms142568%28v=SQL.90%29.aspx

ColdFusion 8 / Verity

"Building a Search Interface"

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=indexSearch_01.html#1164916

"Using Verity Search Expressions"

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=indexSearch02_1.html#1160419