Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching an acronym 1

Status
Not open for further replies.

damipera

Technical User
Dec 1, 2005
134
GB
Hi guys!

Do you have any ideas as to how I could search for an acronym, for example 'ONO', with result that excludes other noise results like in id's 1, 2 and 3?

id wordtestcolumn
--- -----------------
1 the economy sucks
2 bono is great
3 sonograph is great
4 our ONO is number one in taste and service

Can this be done? Is this done in the .net script, SQL statement or in the database level(TSQL)? I am working on SQL server. Using wildcard like ...LIKE '%ONO%' seems to be not doing the trick.

Thanks for any inputs.
 
there are many ways of doing this. and the filtering can be done where you want. granted some technologies are better at filtering than others. This is simple enough that you can change your criteria from [tt]LIKE '%ONO%'[/tt] to [tt]LIKE '% ONO %'[/tt].

DB filtering is the best choice. however the Like operator needs to preform a full table scan to get the results. this is the slowest query method. If your table don't have thousands of rows this isn't an issue, but as it grows this could become a problem.

another option is to implement Sql Server Full Text Indexing. I haven't worked with that directly, but it would help with query execution (if this is a problem).

There is also a 3rd party tool call Lucene.Net which is a indexing framework. This is a port from Java's Lucene. This could also be another option. the Lucene for Java book is the best reference. .net to java is almost a 1:1 port.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
YOu would have to use case sensitivity to get the values you want. you can use a datatable.select()
 
thanks very much jmeckley, LIKE '% ONO %' seems to be doing the trick. but I will have a look also of your other suggestions.

thank you also jbenson001 for your advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top