Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fulltext CONTAINS not consistent

Status
Not open for further replies.

tinac99

Programmer
Jan 17, 2002
58
US
Hi,

I have a record in the "books" table, column "rawtext" of type varchar which starts with "This is a sample of the case-----------------------------OC Register".

When I try to run query:

select * from books where contains(books.*, '"this is*"'), the query does not return anything. It is working for other phrases and one-word searches. The execution of the select statement has not been consistent.

My fulltext index definition is:
CREATE FULLTEXT INDEX ON dbo.books
(
Topic
Language 1033,
RawText
Language 1033
)
KEY INDEX PK_books


Thanks for your help!

tinac99
 
I'm sure there are a number of ways to approach this.
Here is my solution.

Change:
Code:
select * from books where contains(books.*, '"this is*"')

To:
Code:
SELECT * FROM books where rawtext LIKE '"This is%'

Note: In this case, the '*' is not used as a wildcard; however, '%' is.

If at first you don't succeed, then sky diving wasn't meant for you!
 
thanks for the reply, bluejay. but I need to search the word(s) in multiple columns in multiple tables. My example above is just the simplified version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top