Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / April 2006

Tip: Looking for answers? Try searching our database.

Wildcardsearch behaviour in FTS SQL2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
renedevries@gmail.com - 24 Apr 2006 23:23 GMT
Hello,

We recently migrated to the Windows 2003 and SQL2005. Besides many
things we have not pretty much tackled, there is one issue remaining
that I don't understand: Consider this query:-

SELECT TOP 250 *
FROM [news]         [news] INNER JOIN
     CONTAINSTABLE([news_recent], [content],
                   '("J* K*")'
                   ) AS con ON [news].[id] = con.[key]

Language setting is Neutral, both "J" and "K" are in the noise word
list.

The result of this query is that it treats this as an OR query, i.e.
every record that contains a word beginning with a J, or a word
containing with a K. And that is quite a few hits indeed..

Why is the space interpreted as an OR, more importanly, what do I need
to do to get rid of it? In the previous version it was sufficient to
put something like this between quotes. I've tried many variations of
adding quotes, none have given me the expected result.

Cheers,

René de Vries

P.S. version info:
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)   Oct 14 2005
00:33:37   Copyright (c) 1988-2005 Microsoft Corporation  Standard
Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
Hilary Cotter - 25 Apr 2006 15:38 GMT
I don't get the same results. There are a couple of problems here, the first
is that you are querying the news table, but joining it against the results
of the full-text indexed table news_recent. This could be by design.

Secondly, I don't get the OR behavior, by default I get the AND behavior -
but it really is a phrase based query that I get results to - for example
where the word beginning with j is followed by a word beginning with k . To
absolutely positively get an AND, it a word beginning with a j and a word
beginning with a k occurring in the same column of the same row you would
have to do something like this:

SELECT TOP 250 *
FROM [news]         [news] INNER JOIN
     CONTAINSTABLE(news, content, '"J* K*"'
                   ) AS con ON [news].[id] = con.[key]

Not here, that I am joining on the results of a fulltext search of news, and
not news_recent like you do.

By any chance is there an indexed view in the mix somehow?

Signature

Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

Hello,

We recently migrated to the Windows 2003 and SQL2005. Besides many
things we have not pretty much tackled, there is one issue remaining
that I don't understand: Consider this query:-

SELECT TOP 250 *
FROM [news]         [news] INNER JOIN
     CONTAINSTABLE([news_recent], [content],
                   '("J* K*")'
                   ) AS con ON [news].[id] = con.[key]

Language setting is Neutral, both "J" and "K" are in the noise word
list.

The result of this query is that it treats this as an OR query, i.e.
every record that contains a word beginning with a J, or a word
containing with a K. And that is quite a few hits indeed..

Why is the space interpreted as an OR, more importanly, what do I need
to do to get rid of it? In the previous version it was sufficient to
put something like this between quotes. I've tried many variations of
adding quotes, none have given me the expected result.

Cheers,

René de Vries

P.S. version info:
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)   Oct 14 2005
00:33:37   Copyright (c) 1988-2005 Microsoft Corporation  Standard
Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.