Wednesday, March 7, 2012

Multiple columns full text search doesn't seems to work properly

Hi all !
I have a full text search index on a table with several fields
indexed.
I tried the following query :
SELECT MyIndexedTable.MyIndexedTableID
MyIndexedTable.Title,
KEY_TBL.RANK RANK_Total
FROM
MyIndexedTable
INNER JOIN
CONTAINSTABLE(MyIndexedTable,*,'"sport" AND "news"') AS KEY_TBL
ORDER BY KEY_TBL.RANK DESC
There are some records that are not returned by the query but they
have the words "sport" and "news" in their fields.
Any idea what could be happening?
Thanks in advance.
Xavi
This should work. Note that sports and news will have to be in the same
column to get a hit form this row.
"Xavi" <xaspas@.gmail.com> wrote in message
news:1177326871.889457.41300@.e65g2000hsc.googlegro ups.com...
> Hi all !
> I have a full text search index on a table with several fields
> indexed.
> I tried the following query :
> SELECT MyIndexedTable.MyIndexedTableID
> MyIndexedTable.Title,
> KEY_TBL.RANK RANK_Total
> FROM
> MyIndexedTable
> INNER JOIN
> CONTAINSTABLE(MyIndexedTable,*,'"sport" AND "news"') AS KEY_TBL
> ORDER BY KEY_TBL.RANK DESC
> There are some records that are not returned by the query but they
> have the words "sport" and "news" in their fields.
> Any idea what could be happening?
> Thanks in advance.
> Xavi
>
|||Exactly but I'd like to know how to make it work when words are
located in different fields.
I have read about creating an extra Text (or nText) field with all the
content in it and then create an index based on that field, I also
have seen something using unions and multiple querys on the index. I
wonder if there's any better approach and which one will give better
perfomance.
Thank you for your answer!
Xavi
On 23 abr, 14:31, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> This should work. Note that sports and news will have to be in the same
> column to get a hit form this row.
> "Xavi" <xas...@.gmail.com> wrote in message
> news:1177326871.889457.41300@.e65g2000hsc.googlegro ups.com...
>
>
|||The concatenated column offers the best performance.
"Xavi" <xaspas@.gmail.com> wrote in message
news:1177335970.294430.289990@.p77g2000hsh.googlegr oups.com...
> Exactly but I'd like to know how to make it work when words are
> located in different fields.
> I have read about creating an extra Text (or nText) field with all the
> content in it and then create an index based on that field, I also
> have seen something using unions and multiple querys on the index. I
> wonder if there's any better approach and which one will give better
> perfomance.
> Thank you for your answer!
> Xavi
> On 23 abr, 14:31, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
>

No comments:

Post a Comment