1

I've seen several questions on SO about the possibility of matching partial words in a Full-Text Search on SQL Server but they are all quite old so I'm posting to see if there is an update on the situation...

The Problem:

I have a keyword search running on a single field in a table that is using Full-Text Search. I want to be able to match a partial word, not just a wildcard search from the start of a given word.

So, I know I can do:

Contains(table.myfield, '"par*"' which will match things like party, partner etc...

I also want to be able to say:

Contains(table.myfield, '"*par*"' to match things like spartan, sparing etc...

Is it true to say that FTS cannot achieve this and I would have to resort to LIKE '%par%' to get the results I require?

Community
  • 1
  • 1
scgough
  • 5,099
  • 3
  • 30
  • 48

1 Answers1

1

Full-Text Search still does not allow double wildcard. However, you can now use Azure Search to perform regular expressions searches on multiple columns at the same time using Lucene syntax as explained here. For example to search for all jobs with either the term Senior or Junior you can do the following search:

&queryType=full&$select=business_title&search=business_title:/(Sen|Jun)ior/

Alberto Morillo
  • 13,893
  • 2
  • 24
  • 30