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

contains problem

Status
Not open for further replies.

DvDvDvDv

Programmer
May 24, 2001
100
PT
Hi all
I got a problem using contains on several tables.

My statement has the following format:

WHERE (Contains()) AND (Contains())

The first contains matches 2 results
The second matches 78, in whis are included the 2 first. Logically the AND would find these 2 results, but doesn't find any.

What's happening ?

Here are my statements:

With No results:
SELECT DISTINCT Documento.DocID, Documento.Data_Doc, Documento.Descricao, Documento.ID, Documento.Tipo_doc, Documento.Projecto, Documento.Localizacao, Documento.Texto FROM Documento INNER JOIN Sumarios ON Documento.DocID = Sumarios.DocID INNER JOIN Topicos ON Sumarios.ID = Topicos.SumID AND Sumarios.DocID = Topicos.DocID
WHERE ((CONTAINS (Documento.*, '"maciços*"') OR CONTAINS (Sumarios.*, '"maciços*"') OR CONTAINS (Topicos.*, '"maciços*"'))AND(CONTAINS (Documento.*, '"cap*"') OR CONTAINS (Sumarios.*, '"cap*"') OR CONTAINS (Topicos.*, '"cap*"')))

With 2 results:
SELECT DISTINCT Documento.DocID, Documento.Data_Doc, Documento.Descricao, Documento.ID, Documento.Tipo_doc, Documento.Projecto, Documento.Localizacao, Documento.Texto FROM Documento INNER JOIN Sumarios ON Documento.DocID = Sumarios.DocID INNER JOIN Topicos ON Sumarios.ID = Topicos.SumID AND Sumarios.DocID = Topicos.DocID
WHERE ((CONTAINS (Documento.*, '"maciços*"') OR CONTAINS (Sumarios.*, '"maciços*"') OR CONTAINS (Topicos.*, '"maciços*"')))

With 78 Results:
SELECT DISTINCT Documento.DocID, Documento.Data_Doc, Documento.Descricao, Documento.ID, Documento.Tipo_doc, Documento.Projecto, Documento.Localizacao, Documento.Texto FROM Documento INNER JOIN Sumarios ON Documento.DocID = Sumarios.DocID INNER JOIN Topicos ON Sumarios.ID = Topicos.SumID AND Sumarios.DocID = Topicos.DocID
WHERE ((CONTAINS (Documento.*, '"cap*"') OR CONTAINS (Sumarios.*, '"cap*"') OR CONTAINS (Topicos.*, '"cap*"')))


Please HEEEEEEEEEELP
 
Dumb question but it needs to be asked ... Do you have Full-Text Searching enabled on the table. That is the only way the contains verb will operate.

Thanks

J. Kusch
 
Here's what it looks like to me:

You have 2 rows that contain at least one of these:
(Documento.*, '"maciços*"')
(Sumarios.*, '"maciços*"')
(Topicos.*, '"maciços*"')

You have 78 rows that contain at least one of these:
(Documento.*, '"cap*"')
(Sumarios.*, '"cap*"')
(Topicos.*, '"cap*"')

But, you DON'T have any rows that contain at least one from BOTH options (one from the first three and one from the bottom three).

-SQLBill

 
Yes.

First of all: yes I have the full text indexing populated.

Conceptually, My problem is:

I need to search for those 2 words and they can be in any of the 3 tables. Those tables are related and are the same record, for instance.

When I look for maciços, this word is on one of the tables related to the record 69 and 122 (for instance).

When I look for cap, there are 78 records having this word in one of the 3 tables.

The 69 and 122 records are included on those 78.

When I look for the 2 criterias I don't find any result.

Dv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top