Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 CONTAINS predicate not returning results....

Author  Topic 

matt_calhoon
Posting Yak Master

235 Posts

Posted - 2001-12-13 : 01:57:24
Hi There,

Im running MS SQL 7.0 on Win2k.

Im searching a table that is full text indexed with the following SQL:

SELECT CONTENT FROM tbl_SEARCH_DOCUMENTS
WHERE TITLE like '%Office Environmental%' OR
CONTAINS (Content, '"Office Environmental"')

My table has been fully populated and the text "Office Environmental" is located in the specified column to search on. However I am not getting any results. I have found when I use only one word (either Office or Environmental) it will return results - but when I use more than one word in the CONTAINS statement, I don't get any results.

Is this a bug or am I missing something?

thanks - Matt

Nazim
A custom title

1408 Posts

Posted - 2001-12-13 : 04:45:38
just tried something like that

it worked strangely

my query was something like this

select * from table1 where contains(custname,'"Office Documentation"')

it displayed me 4 records containing it(the fact i entere 10 records some with trailing spaces)

again i changed it to

select * from table1 where contains(custname,'"Office Documentation*"')

it displayed me all the records.

the fun is after running this query when i re-run the first query it gives me all the records :).

i think Matt u better use wild card character * with contains , it should help u.




-------------------------
"Success is when Preparedness meets Opportunity"
Go to Top of Page

matt_calhoon
Posting Yak Master

235 Posts

Posted - 2001-12-13 : 18:28:12
I have now restored the database on my development server (from the production server backup) and I get results when searching using the contains statement - but for some reason on the production server I dont get results. I have rebuilt the catalog on the production server several times and re populated but I still dont get the records returned.

this is a weird one!

Go to Top of Page

matt_calhoon
Posting Yak Master

235 Posts

Posted - 2001-12-13 : 19:10:50
Ok - upon further investigation I have found several event logs similar to the following:

Unable to access crawl seed <MSSQL://LOCALHOST/62.1029578706> in project <SQLSERVER SQL0006200005> ERROR 8007052e - Logon failure unkown username or bad password

So I assume there is a bad password floating around in some service - I have checked the MSSQL Server Agent and Microsoft Search service and they seem to be operating fine. Where can I find the culprit for this bad logon?

- least Ill stop cursing the CONTAINS statement!

cheers - matt

Go to Top of Page

matt_calhoon
Posting Yak Master

235 Posts

Posted - 2001-12-13 : 19:33:47
Woo hoo!

fixed with this kb:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q277549

Go to Top of Page
   

- Advertisement -