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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

indexing full text search is not working

Status
Not open for further replies.

prasadalone

Programmer
Aug 15, 2002
87
I am facing problem while searching the contents in html contents eg.Contents in text field is like this <B>AIR 501 822 33</b> when i try to search using follwoing query select * from cl where contains(citation,'"AIR 501 822 33'") i am not getting any result but if i run the following query i am getting result select * from cl where contains(citation,'"AIR 501 822 33</B>'")
can any one tell me whats the problem i want the query to ignore the html contents waiting for your reply
 
I think this might be because SLQ is 'seeing' 33</B> as a whole word and your 33 does not match it.

Note I've never used full text search but had a look a BOL so feel free to correct me! Have you tried select * from cl where contains(citation,'"AIR 501 822 33*'") which should I think be interpeted as anything with a word starting AIR 501 822 33.

I don't know if there is a way to force sql to ignore any HTML content.
 
SQL doesn't know what HTML is so there isn't any way for it to know to ignore it. The problem is just as arrowhouse said, SQL is seeing the HTML tag as part of the word. When loading the data into the table if you can put a space before the HTML tag that will be your best bet.

CONTAINS does support wild cards, however they don't work quite as expected. Check BOL for the term "CONTAINS predicate".

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top