You can create a separate column where dashes are removed from these words, then perform your full text searches against that column.
For example, your table could look like this (or the new column could be part of a new table):
Id Text TextForFullTextSearch
-----------------------------------------
1 Jim-beam Jimbeam
2 F-10 F10
3 blah blah blah blah
If you need to support searches on both "Jimbeam*"
and "Jim-beam*"
then you could perform the full text search against both the old and new columns.
This does require you to store the text twice so there will be more gears in your process. The benefits will be in the search accuracy and performance (LIKE will be much slower), so you'll have to weigh those benefits against the increased complexity.
Some ideas for populating the new column as data is inserted and updated:
- Handle this in your data layer, i.e. all insert and update statements should include both Text and TextForFullTextSearch.
- Add an insert/update trigger to the table that, whenever Text is inserted or updated, simultaneously updates TextForFullTextSearch.
- Create an automated job that continually polls the table for inserts/updates, then updates TextForFullTextSearch accordingly.