Re: FREETEXT / CONTAINS question
- From: "Hilary Cotter" <hilary.cotter@xxxxxxxxx>
- Date: Thu, 29 May 2008 05:16:02 -0400
You should always wrap your search terms in double quotes for contains. For example if you were searching on Guitar player and America (note the double word first search term) you would have to search like this
select * from mytable where contains (*, '"guitar player" and America)
Otherwise your search would fail. For single word search tokens, as Daniel has pointed out this will work.
"Daniel Crichton" <msnews@xxxxxxxxxxxxxxxx> wrote in message news:%23XWmAYWwIHA.1980@xxxxxxxxxxxxxxxxxxxxxxx
admlangford@xxxxxxxxx wrote on Wed, 28 May 2008 13:22:43 -0700 (PDT):
Hi, I am using the WITH FREETEXT command against my database.
The problem I am having is that the WITH FREETEXT treats seperate words
passed in using an OR
so instead of getting a search for 'Guitar AND Player AND America' I am
getting 'Guitar OR player OR America'
From looking around I can use the CONTAINS and build something like
this...
WITH CONTAINS(Titles,'Guitar) AND CONTAINS(Titles,'Player') AND
CONTAINS(Titles,'America')
CONTAINS allows you to use AND in the term. You would only need to do the above using FREETEXT.
SELECT * FROM MyTable WHERE CONTAINS(Titles,'Guitar and America')
--
Dan
.
- References:
- FREETEXT / CONTAINS question
- From: admlangford
- Re: FREETEXT / CONTAINS question
- From: Daniel Crichton
- FREETEXT / CONTAINS question
- Prev by Date: Re: FREETEXT / CONTAINS question
- Previous by thread: Re: FREETEXT / CONTAINS question
- Index(es):
Relevant Pages
|