Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 full text query using CONTAINS

Author  Topic 

thakks
Starting Member

1 Post

Posted - 2014-10-01 : 10:45:18

Hello friends,
I am looking to filter the query using the free text predicate Contains for one of the column that have dimensions of the items. The query is something like

Select * from sampletable
where contains(filtercolumn, 'Near("*cm , *cm , *cm , *Kg.",10,True)')

Data in the filtercolumn is something like 64cm x 25cm x 35cm = 10Kg.

The query do not return any data. Please advise.

I also tried running the below query to see if cm* can be searcher for, but with no result again

Select * from sampletable
where contains(filtercolumn,, '"cm*"')


If I do something like below, it does return all columns that have 35cm within the text.
Select * from sampletable
where contains(filtercolumn,, '"35cm"')

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-10-01 : 13:00:09
You can't use a leading wildcard. Please see this discussion: http://stackoverflow.com/questions/3400/how-do-you-get-leading-wildcard-full-text-searches-to-work-in-sql-server

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -