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 / July 2008

Tip: Looking for answers? Try searching our database.

Full-Text doesn't retrieve the # of rows I am expecting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Corobori - 25 Jul 2008 20:39 GMT
I am new to Full-Text search and learning about it.

I am having an issue with the number of rows retrieved.

The 1st query shown below

[code]Select Ai_Id,Ai_Texto FROM  tblAvisosInternet
WHERE Ai_Texto like '%Toyota%' AND Ai_Texto like '%Yaris%'
ORDER BY Ai_Id
[/code]

retrieves 622 rows

Then I started using the CONTAINS keyword

[code]Select Ai_Id,Ai_Texto FROM  tblAvisosInternet
WHERE CONTAINS(Ai_Texto, 'Toyota AND Yaris')
ORDER BY Ai_Id[/code]

or
[code]
SELECT     Ai_Id, Ai_Texto
FROM         tblAvisosInternet
WHERE     CONTAINS(Ai_Texto, '"%Toyota%" AND "%Yaris%"')
ORDER BY Ai_Id[/code]

this retrieves 552 rows missing rows such as "TOYOTA YarisSport
2005...." where Yaris is glued to another word

On another forum somebody suggested this

[code]
Select Ai_Id,Ai_Texto FROM  tblAvisosInternet
WHERE CONTAINS(Ai_Texto, '"*Toyota*" AND "*Yaris*"')
ORDER BY Ai_Id
[/code]

Which retrieves 571 rows missing rows such as "TOYOTA NewYarisSport,
año2007,".

What am I missing ?

jean-luc
www.corobori.com
Daniel Crichton - 28 Jul 2008 16:02 GMT
Corobori wrote  on Fri, 25 Jul 2008 12:39:07 -0700 (PDT):

> I am new to Full-Text search and learning about it.

> I am having an issue with the number of rows retrieved.

> The 1st query shown below

> [code]Select Ai_Id,Ai_Texto FROM  tblAvisosInternet
> WHERE Ai_Texto like '%Toyota%' AND Ai_Texto like '%Yaris%'
> ORDER BY Ai_Id [/code]

> retrieves 622 rows

> Then I started using the CONTAINS keyword

> [code]Select Ai_Id,Ai_Texto FROM  tblAvisosInternet
> WHERE CONTAINS(Ai_Texto, 'Toyota AND Yaris')
> ORDER BY Ai_Id[/code]

> or [code]
> SELECT     Ai_Id, Ai_Texto
> FROM         tblAvisosInternet
> WHERE     CONTAINS(Ai_Texto, '"%Toyota%" AND "%Yaris%"')
> ORDER BY Ai_Id[/code]

> this retrieves 552 rows missing rows such as "TOYOTA YarisSport
> 2005...." where Yaris is glued to another word

> On another forum somebody suggested this

> [code]
> Select Ai_Id,Ai_Texto FROM  tblAvisosInternet
> WHERE CONTAINS(Ai_Texto, '"*Toyota*" AND "*Yaris*"')
> ORDER BY Ai_Id [/code]

> Which retrieves 571 rows missing rows such as "TOYOTA NewYarisSport,
> año2007,".

> What am I missing ?

> jean-luc www.corobori.com

% is not a wildcard for FTS. You can use *, but only to mark the end of
words, eg. you can use Yaris* which will find YarisSport, but you cannot use
*Yaris or *Yaris*.

FTS is not doing the same as a LIKE which is a simple text match - it breaks
the string up into words and indexes those, and YarisSport is a single word
as is NewYarisSport and so are treated differently than Yaris.

Dan
Corobori - 29 Jul 2008 21:56 GMT
By the sound of it I won't be able to achieve what I want using FTS ?
I tried using "FORMSOF(INFLECTIONAL, "Yaris")" but it didn't work
either. A shame because it's blazing fast.

Jean-Luc

On Jul 28, 11:02 am, "Daniel Crichton" <msn...@worldofspack.com>
wrote:
> Corobori wrote  on Fri, 25 Jul 2008 12:39:07 -0700 (PDT):
>
[quoted text clipped - 35 lines]
>
> Dan
Daniel Crichton - 30 Jul 2008 09:31 GMT
Can you not change your data to split up the words correctly? ie. store
NewYarisSport as New Yaris Sport.

Dan

Corobori wrote  on Tue, 29 Jul 2008 13:56:04 -0700 (PDT):

> By the sound of it I won't be able to achieve what I want using FTS ?
> I tried using "FORMSOF(INFLECTIONAL, "Yaris")" but it didn't work
> either. A shame because it's blazing fast.

> Jean-Luc

> On Jul 28, 11:02 am, "Daniel Crichton" <msn...@worldofspack.com>
> wrote:
>> Corobori wrote  on Fri, 25 Jul 2008 12:39:07 -0700 (PDT):

>>> I am new to Full-Text search and learning about it.
>>> I am having an issue with the number of rows retrieved.
[quoted text clipped - 22 lines]
>>> What am I missing ?
>>> jean-lucwww.corobori.com

>> % is not a wildcard for FTS. You can use *, but only to mark the end
>> of words, eg. you can use Yaris* which will find YarisSport, but you
>> cannot use *Yaris or *Yaris*.

>> FTS is not doing the same as a LIKE which is a simple text match - it
>> breaks the string up into words and indexes those, and YarisSport is
>> a single word as is NewYarisSport and so are treated differently than
>> Yaris.

>> Dan
Hilary Cotter - 30 Jul 2008 11:37 GMT
You might want to use the thesaurus option where an expansion for
NewYarisSport would be New Yaris Sport.

This will work with a freetext search.

> Can you not change your data to split up the words correctly? ie. store
> NewYarisSport as New Yaris Sport.
[quoted text clipped - 49 lines]
>
>  >> Dan
 
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



©2008 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.