G Grant Holman New Member Oct 5, 2015 #1 Is it possible to NOT a CONTAINS clause on a WORD-INDEX? e.g. where field contains 'cat' but NOT 'dog' Thanks
Is it possible to NOT a CONTAINS clause on a WORD-INDEX? e.g. where field contains 'cat' but NOT 'dog' Thanks
O Osborne Active Member Oct 5, 2015 #2 It might be a bit slow but I suppose you could do something like this: Code: FOR EACH customer NO-LOCK WHERE customer.Comments CONTAINS "cat" AND INDEX( customer.comments, "dog") = 0: END.
It might be a bit slow but I suppose you could do something like this: Code: FOR EACH customer NO-LOCK WHERE customer.Comments CONTAINS "cat" AND INDEX( customer.comments, "dog") = 0: END.
RealHeavyDude Well-Known Member Oct 6, 2015 #3 I believe it will definately be slow since the compiler can't bracket on an index and it will cause a table scan to resolve it. I would have it this way: Code: for each customer no-lock where customer.comments contains "cat": if index ( customer.comments, "dog" ) = 0 then do: /* Your stuff */ end. end. Heavy Regards, RealHeavyDude.
I believe it will definately be slow since the compiler can't bracket on an index and it will cause a table scan to resolve it. I would have it this way: Code: for each customer no-lock where customer.comments contains "cat": if index ( customer.comments, "dog" ) = 0 then do: /* Your stuff */ end. end. Heavy Regards, RealHeavyDude.