Re: [sqlite] Prefix searching for fts2.

2007-05-01 Thread Scott Hess

On 5/1/07, Samuel R. Neff <[EMAIL PROTECTED]> wrote:

One suggestion though, instead of (or in addition to) using '*' as the
prefix operator perhaps '%' would be more appropriate in order to be closer
to the LIKE operator.


Hmm.  I was mainly just doing what other groups appear to do (Lucene,
MYSQL, MS SQL).  Using % would also make sense.  Obviously it would
also be nice to have ?/_, and to allow any of those be be embedded
(though the term would still need to be anchored with a real letter at
the front).  I'd also like to be able to do queries on the terms
themselves.

Thanks,
scott

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Prefix searching for fts2.

2007-05-01 Thread Samuel R. Neff
This is great!  The main reason we decided not to use FTS in our project was
lack of prefix searching.  With this new functionality we'll probably switch
to using FTS in a future update.

One suggestion though, instead of (or in addition to) using '*' as the
prefix operator perhaps '%' would be more appropriate in order to be closer
to the LIKE operator.

Best regards,

Sam 


---
We're Hiring! Seeking a passionate developer to join our team building
products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 
-Original Message-
From: Scott Hess [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 01, 2007 2:36 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Prefix searching for fts2.

I just finished ( http://www.sqlite.org/cvstrac/chngview?cn=3893 )
checking in a string of changes to fts2.c to provide prefix search.
This works like:

...

-scott


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Prefix searching for fts2.

2007-05-01 Thread Scott Hess

I just finished ( http://www.sqlite.org/cvstrac/chngview?cn=3893 )
checking in a string of changes to fts2.c to provide prefix search.
This works like:

 CREATE VIRTUAL TABLE t USING fts2(c);
 INSERT INTO t (c) VALUES ('This is a test');
 INSERT INTO t (c) VALUES ('That was a test');
 INSERT INTO t (c) VALUES ('A third phrase');
 SELECT snippet(t) FROM t WHERE t MATCH 'th*';
 -- This is a test
 -- That was a test
 -- A third phrase
 SELECT snippet(t) FROM t WHERE t MATCH '"a t*"';
 -- This is a test
 -- That was a test
 -- A third phrase

Please let me know of any bugs found.

The code should always be approximately as performant as the previous
code for non-prefix searches or for prefix searches matching a single
item.  As currently implemented, it is not as strong as I should like
on searches which match a large number of terms.

-scott

-
To unsubscribe, send email to [EMAIL PROTECTED]
-