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
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