-
-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Milestone
Description
ArcadeDB Server v26.2.1 (build ced6531188602179fef91d7f831373e7ff47284c/1771258648678/UNKNOWN)
Running on Linux 6.17.0-14-generic - OpenJDK 64-Bit Server VM 21.0.10
As a disclaimer to understand this problem one needs to be aware that the CONTAINSTEXT operator works in two different modes:
- If applied to a un-indexed property or literal it acts just like a simple
containsmethod - If applied to a full-text indexed property it acts case in-sensitive and performs an OR-combined search given on the right-hand side either an array of strings or string which is split by spaces
Now, a compound filter with multiple CONTAINSTEXT sub-filters causes the sub-filters to act like on an un-indexed property, even though EXPLAIN reports that each sub-filter acts on an index fetch.
Example:
Given:
CREATE DOCUMENT TYPE doc;
CREATE PROPERTY doc.txt STRING;
CREATE INDEX ON doc(txt) FULL_TEXT;
INSERT INTO doc SET txt = 'This is a test'it is working for a single filter:
SELECT FROM doc WHERE (txt CONTAINSTEXT 'is') -- 1 result
SELECT FROM doc WHERE (txt CONTAINSTEXT 'a is') -- 1 result
SELECT FROM doc WHERE (txt CONTAINSTEXT 'IS') -- 1 resultbut for multiple filters (here the same ones, combined with an OR) it fails:
SELECT FROM doc WHERE (txt CONTAINSTEXT 'is') OR (txt CONTAINSTEXT 'is') -- 1 result
SELECT FROM doc WHERE (txt CONTAINSTEXT 'a is') OR (txt CONTAINSTEXT 'a is') -- 0 results
SELECT FROM doc WHERE (txt CONTAINSTEXT 'IS') OR (txt CONTAINSTEXT 'IS') -- 0 resultsince no results are returned for non-exact search words.
Reactions are currently unavailable