Re: [sqlite] FTS3 (Version 2 .6.23) - Is the boolean operator "AND" no more available?

2010-03-15 Thread Max Vlasov
> I wonder if the operator "AND" (in capitals letters) is yet available and
> different from the basic term "and" (in lower letters).
>
>
Make sure you compiled the sources with SQLITE_ENABLE_FTS3_PARENTHESIS,
since according to docs

SQLITE_ENABLE_FTS3_PARENTHESIS
This option modifies the query pattern parser in FTS3 such that it
supports operators AND and NOT (in addition to the usual OR and NEAR) and
also allows query expressions to contain nested parenthesesis.

Max
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] FTS3 (Version 2 .6.23) - Is the boolean operator "AND" no more available?

2010-03-15 Thread Dan Kennedy

On Mar 14, 2010, at 5:34 AM, gerard.jouannot wrote:

> 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).

Available only if FTS3 is compiled with this option:

   -DSQLITE_ENABLE_FTS3_PARENTHESIS

See:

   http://www.sqlite.org/fts3.html#section_2

Dan.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] FTS3 (Version 2 .6.23) - Is the boolean operator "AND" no more available?

2010-03-14 Thread gerard.jouannot
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 default transaction and the default
models...all these semantics are written
instead of
the default transaction and the default
models...all these semantics are written
 
SELECT quote(matchinfo(t1)) FROM t1 WHERE t1 MATCH 'default AND transaction
AND "these semantics"';
X'050002000500010001000300010001
00020002000100010001
000100'
   ^
   | should be 3, as below:
 
X'030002000500010003000100020001
0001000100'
 
 
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