Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Full Text Search - Is it possible to search in the middle of a word?

I have full text search on my database.

Is it possible to search in the middle of a word for some text?

For example, I have a column Description that contains the following text:

Revolution

Is it possible to search for 'EVO' and have it find it in the word Revolution or am I stuck doing a LIKE:

SELECT * FROM Table WHERE Description LIKE '%EVO%'

Is there a FTS equivalent of the above query?

EDIT
I want to make it clear what I am trying to ask because it appear a few people might be confused. I believe that SQL Server FTS can only search at the beginning of the word (prefix search). So if I query like:

SELECT * FROM Table WHERE CONTAINS(Description, '"Revo*"')

Then it will find the word Revolution. I want to know if it is possible at all to search something in the MIDDLE of the word. Not at the end. Not at the beginning. From what it looks like this is not possible and it makes sense because how would SQL server index this, but I just wanted to be certain.

like image 743
Dismissile Avatar asked Jul 05 '11 16:07

Dismissile


People also ask

How does full text search work in SQL Server?

Full-text queries perform linguistic searches against text data in full-text indexes by operating on words and phrases based on the rules of a particular language such as English or Japanese. Full-text queries can include simple words and phrases or multiple forms of a word or phrase.

How do I find the middle element in SQL?

SQL Median. Median refers to the "middle" number in a series of numbers. When the total count is odd, this is pretty straightforward. Assuming there are n numbers, the median number would be the (n+1)/2-th largest number (or the (n+1)/2-th smallest number -- both are the same number).

How do I find a specific word in a string in SQL?

SQL Server CHARINDEX() Function The CHARINDEX() function searches for a substring in a string, and returns the position. If the substring is not found, this function returns 0. Note: This function performs a case-insensitive search.


1 Answers

This looks like it has come up before and the short answer was "No". Previous thread

like image 120
Adam Schaff Avatar answered Oct 05 '22 23:10

Adam Schaff