Re: Phase?
- From: "Hilary Cotter" <hilary.cotter@xxxxxxxxx>
- Date: Thu, 20 Apr 2006 06:26:54 -0400
try something like this:
alter PROCEDURE [dbo].[proc_publicSearchClassifiedAd]
@SearchWord varchar(255)
AS
BEGIN
SET NOCOUNT ON;
declare @holding varchar(200)
select @holding=char(34)+@SearchWord +char(34)
select SUBJECT,HTMLBody FROM ClassifiedAd
WHERE CONTAINS((SUBJECT,HTMLBody ), @holding);
END
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Phill" <Phill@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:04498026-F445-4526-8C8F-670559877DBF@xxxxxxxxxxxxxxxx
This is my first attempt to write a sp using a full-text search. It is a
straight forward search of a classified ad table where the search words
can
be one or more words. It can be a word like 'Harley' or a phrase like
'for
sale'. The problem I am having is that I get an error if I pass in 'for
sale'. The message is Syntax error near 'sale' in the full-text search
condition 'for sale'. My sp looks like this:
PROCEDURE [dbo].[proc_publicSearchClassifiedAd]
@SearchWord varchar(255)
AS
BEGIN
SET NOCOUNT ON;
SELECT SUBJECT,HTMLBody FROM ClassifiedAd
WHERE CONTAINS((SUBJECT, HTMLBody), @SearchWord);
END
Looking a BOL, I found a reference to 'phrase', which is what I think I
need, but I am having problems with the syntax. The examples don't use a
variable like I am. Does anyone know the syntax? Am I missing anything
else? Thanks.
.
- Follow-Ups:
- Re: Phase?
- From: Phill
- Re: Phase?
- Prev by Date: Re: Fullttext question
- Next by Date: Re: Fullttext question
- Previous by thread: relevance sorting with multiple search terms?
- Next by thread: Re: Phase?
- Index(es):