Free-Text Search "AND NOT" Wrong results - HELP, please!



Hi,

I have a Photo Database, with a Photo table. Each photo has several
Varchar fields for storing caption, description, keywords, etc. I have
a Full-Text index/catalog for these fields.

This is the problem:
I want to find all photos that are related to "Simon" and "Jane", but
no photos taken when they entered or exited the "clinic".

So, my Query looks like:
SELECT *
FROM Fotos LEFT JOIN CONTAINSTABLE(Fotos,*, 'ISABOUT("Simon") AND
ISABOUT("Jane") AND NOT ISABOUT("clinic")') AS KEY_TBL ON Fotos.Cod =
KEY_TBL.[KEY]
WHERE KEY_TBL.Rank>0
ORDER BY ISNULL(KEY_TBL.Rank,0) DESC, ISNULL(Fotos.FotoDate,
Fotos.CreatedDate) DESC

The problem is that it returns photos with descriptions that include
the word "Clinic" (in this particular query, the first row in the
resultset has the word clinic in it!).

I noticed "Simon", "Jane" and "clinic" could reside on different
columns, so I rewrote the query:
SELECT *
FROM Fotos LEFT JOIN CONTAINSTABLE(Fotos,*, 'Simon AND NOT clinic') AS
KEY_TBL0 ON Fotos.Cod = KEY_TBL0.[KEY]
LEFT JOIN CONTAINSTABLE(Fotos,*, Jane AND NOT clinic') AS KEY_TBL1 ON
Fotos.Cod = KEY_TBL1.[KEY]
WHERE KEY_TBL0.Rank+KEY_TBL1.Rank>0
ORDER BY KEY_TBL0.Rank+KEY_TBL1.Rank DESC, ISNULL(Fotos.FotoDate,
Fotos.CreatedDate) DESC

The same problem occurred.

What Am I doing wrong?

Thanks for your help.

JOEL

.



Relevant Pages

  • Insert multiple records into 1 mysql table
    ... data set to insert if it is NOT the last, ... Then you build your insert query by looping through the arrays by ... INSERT INTO photo VALUES ... I have a mysql database and phtml form. ...
    (php.general)
  • Re: Template for Popup Pictures
    ... You could use a database system, which will in your query e.g. ... photo in that category if you have 3 dozen photos of your dog/s. ... > to change on the existing popup rather than having another popup occur. ...
    (microsoft.public.frontpage.client)
  • =?iso-8859-1?Q?Re:_sch=F6ne_Fotos_von_W=F6lfen_t=E4glich?=
    ... einen Wolf ersetzen, mal sehen;-). ... "The Photo of the Day page itself, and all the small photos, will always ... "Die Seite mit dem Foto des Tages und alle kleinen Fotos sind immer ...
    (de.rec.tiere.hunde)
  • =?iso-8859-1?Q?Re:_sch=F6ne_Fotos_von_W=F6lfen_t=E4glich?=
    ... einen Wolf ersetzen, mal sehen;-). ... "The Photo of the Day page itself, and all the small photos, will always ... "Die Seite mit dem Foto des Tages und alle kleinen Fotos sind immer ...
    (de.rec.tiere.hunde)
  • Re: Which contact field stores the photo?
    ... It is not possible to construct a query to do that, ... simple property holding that information. ... Sue Mosher, Outlook MVP ... I ask because I want to email everyone I don't have a photo for. ...
    (microsoft.public.outlook.contacts)

Loading