Wednesday, March 7, 2012

Multiple columns search

Hi there,
I have a quite large products table, with the following fields:
Product_title nvarchar(100)
Product_summary nvarchar(1000)
Product_description text
Is it possible to run a FTS query throughtout all of this 3 fields?
For example, user searches for: "Printer AND Windows AND inkjet". all 3
words never appear on a single column, but they appear on a single ROW. I
would like to output rows that includes all 3 strings.
Obviouslly I can create another table that will attach data from all 3
fileds, but I'm looking for a more elegent solution.
Thanks!
use a freetext or freetextable search like this
select * from tableName where freetext(*, '"SearchPhrase"')
"Guy Brom" <guy_brom@.yahoo.com> wrote in message
news:%23up%231AgIEHA.3032@.TK2MSFTNGP09.phx.gbl...
> Hi there,
> I have a quite large products table, with the following fields:
> Product_title nvarchar(100)
> Product_summary nvarchar(1000)
> Product_description text
> Is it possible to run a FTS query throughtout all of this 3 fields?
> For example, user searches for: "Printer AND Windows AND inkjet". all 3
> words never appear on a single column, but they appear on a single ROW. I
> would like to output rows that includes all 3 strings.
> Obviouslly I can create another table that will attach data from all 3
> fileds, but I'm looking for a more elegent solution.
> Thanks!
>

No comments:

Post a Comment