fts,
To the best of my knowledge (and I've worked with SQL FTS since it was first
incorporated in SQL 7.0 beta3 in 1998), there is no direct way to do this
with SQL FTS. The closest you can come is using the NEAR (or ~ symbol) with
CONTAINS or CONTAINSTABLE, for example:
select * from containstable(Employees,
Notes,'"1970~psychology~University~Nancy"')
will find "1970 near psychology near University near Nancy" but not
necessarily in that order.
I suspect that you're looking for a Google-like functionality, for example
using this string with in double quotes - "sql * best * database" - on
Google this can find "SQL The best designed database". Correct? Assuming so,
you would have to develop your own custom stored proc (or UDF?) to capture
the individual word search results as well as position of each word in the
row into a temp table and then re-order the results based upon search words
and their positions... et.al.
Regards,
John
[quoted text, click to view] "fts" <fts@wrongemail.com> wrote in message
news:482101c3761a$589ce390$a601280a@phx.gbl...
> Thanks for your reply.... However, if I put the "" then
> am I not searching for the exact string match? I guess I
> should have explained a little better...
>
> What I am trying to accomplish is...If someone passes in
> the combination of words...
>
> WORD1 WORD4 WORD2
>
> When searching using FTS...I only want to select records
> that have the pattern WORD1 % WORD4 % WORD2
> These words dont necessarily have to follow one another
> consecutively but when selecting the resultset should be
> occurring in the same order within the search result...
>
> AND
>
> NOT select any records that may have the same words
> occuring in a different order For eg - WORD2 % WORD1 %
> WORD4
>
> Is there a neat way of doing this with FTS?
>
> Thanks again...
>
> >-----Original Message-----
> >wrap your search in double quotes and use a contains or
> >containstable search
> >>-----Original Message-----
> >>We need to have a functionality whereby we can have
> >>Word order dependent search - All words entered appear
> in
> >>the term in the order entered.
> >>
> >>Can we accomplish this using FTS?
> >>
> >>Thanks
> >>.
> >>
> >.
> >