Subject Re: [IBO] FTS: ibo42.r BUG?
Author TeamIBO
Hi John,

I am not familiar with exactly what is supposed to happen inside FTS,
as I have not used it yet - which is why I have kept quiet so far.
However I am not certain that your trigger changes are appropriate.

First lets look at the update trigger as pseudo code...

if the old field value did not contain text (and so does not exist
in the index), and the new field value does contain text (and
so needs to be included in the index) then
Add the command to insert this record into the index
else
if the old field value did contain text (and so does exist in the
index), and the new field value does NOT contain text (and
so needs to be excluded in the index) then
Add the command delete this record from the index
else
if the old field values does contain text (and so does exist in the
index) and the new field value also contains text but this text
is different to the old value (and so the index needs updating)
then
Add the command to update the record in the index


I must admit that I am not a big fan of complex if statments,
especially when they contain '<>'. But rather than trying to
completely rewrite the code in simplified format lets try to review
the actual code in light of the above...


The first section (IF ... THEN insert entry)...

* Old Field Value did not contain text (was blank or null)
(( OLD.DIRECTIONS IS NULL ) OR ( OLD.DIRECTIONS = '' ))

* New Field Value does contain text (not blank and not null)
(( NEW.DIRECTIONS IS NOT NULL ) AND ( NEW.DIRECTIONS <> '' ))

thats the original code and I think it is correct. Placing an OR
in the second phrase will allow blank values through (because blank is
NOT NULL so the first condition succeeds and the next condition is not
evaluated).

The remaining (original) trigger code appears to follow the same
logic, so I dont think your problem is coming from there.

The above does make me wonder if you are expecting events when none
are necessary or appropriate? Eg. No change to the field in question.


--
Geoff Worboys - TeamIBO
Telesis Computing