Hello all SQLlite users.
 
I wonder if the operator "AND" (in capitals letters) is yet available and
different from the basic term "and" (in lower letters).
 
Using the "MatchInfo" example of the documentation, I build an FTS3 virtual
table like this:
-- Create and populate an FTS3 table with four rows of two columns:


CREATE VIRTUAL TABLE t1 USING fts3(a, b);
INSERT INTO t1 VALUES('transaction default models default', 'Non transaction
reads');
INSERT INTO t1 VALUES('the default transaction', 'these semantics present');
INSERT INTO t1 VALUES('single request', 'default data');
INSERT INTO t1 VALUES('the default transaction and the default models', 'all
these semantics are written');

The documentation of FTS3 says: "the results are the same as if the two
basic queries were separated by an AND operator". In this case, these 2
lines should be equivalent, giving the same results:
 
SELECT ROWID FROM t1 WHERE t1 MATCH 'default transaction "these semantics"';
----> Results OK: 2 rowids (2 and 4)
SELECT ROWID FROM t1 WHERE t1 MATCH 'default AND transaction AND "these
semantics"'; ----> Results false: 1 rowid (4)
 
In fact, it seems that the second SELECT is equivalent to this one (where
the term "and" is in lower letters): 
 
SELECT ROWID FROM t1 WHERE t1 MATCH 'default and transaction and "these
semantics"'; ----> Results OK: 1 rowid (4)
 
Is an erroneous understanding of the documentation or a bug?
 
A bug should explain that using the snippet function or the new MatchInfo
function, I obtain these results:
 
SELECT snippet(t1) FROM t1 WHERE t1 MATCH 'default AND transaction AND
"these semantics"';
the <b>default</b> <b>transaction</b> <b>and</b> the <b>default</b>
models<b>...</b>all <b>these</b> <b>semantics</b> are written
instead of
the <b>default</b> <b>transaction</b> and the <b>default</b>
models<b>...</b>all <b>these</b> <b>semantics</b> are written
 
SELECT quote(matchinfo(t1)) FROM t1 WHERE t1 MATCH 'default AND transaction
AND "these semantics"';
X'05000000020000000500000001000000010000000000000003000000010000000100000000
0000000000000002000000020000000000000001000000000000000100000000000000010000
00000000000000000001000000'
   ^
   | should be 3, as below:
 
X'03000000020000000500000001000000030000000100000000000000020000000100000000
00000001000000000000000000000001000000'
 
 
Could you check it?
 
Many thanks for any explanation.
 
Best regards
 
GĂ©rard
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to