OK...that make sense...so i hook up my own tokenizer....then how do I allow the 
hyphen to really mean hyphen and not "NOT".
 
I would've expected "play-off" to be ok and "play -off" to be the NOT operator.
 
Is there some reason why whitespace isn't being taken into account to determine 
the meaning of the hypen?
 
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Northrop Grumman Information Systems
 

________________________________

From: sqlite-users-boun...@sqlite.org on behalf of Dami Laurent (PJ)
Sent: Sat 10/2/2010 2:38 PM
To: General Discussion of SQLite Database
Subject: EXTERNAL:Re: [sqlite] FTS Question



Hi Michael,

While indexing, the standard tokenizer treats 'play-off' as two different 
words, so the indexing is exactly the same as for 'play off' or 'play, off'.

Now when querying, the query analyzer treats the hyphen as 'AND NOT', so your 
query really becomes 'play AND NOT off', which explains the result.

Clearly this behaviour is quite rudimentary, not what one would expect when 
being accustomed to Google or other powerful search engines ... but that's what 
the current version of FTS3 has to offer.

To obtain more sophisticated behaviour, you would have to implement your own 
tokenizer and hook it to FTS3. The doc explains how to do this.

Best regards, Laurent Dami


>-----Message d'origine-----
>De : sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] De la part de Black, Michael (IS)
>Envoyé : vendredi, 1. octobre 2010 16:54
>À : General Discussion of SQLite Database
>Objet : [sqlite] FTS Question
>
>I'm experimenting with the FTS capability and have a question....
>
>How do I enter a value in the database that is hyphenated?  Seems to be
>backwards form what I would expect....if the content contains a hyphen
>then only non-hyphenated query returns the correct value whereas the
>hyphenated one returns the wrong one.
>
>This seems to not work correctly...or am I missing a concept here?
>
>SQLite version 3.7.2
>sqlite> create virtual table dict using fts3(content);
>sqlite> insert into dict values('play-off');
>sqlite> insert into dict values('play-back');
>sqlite> select * from dict where content match 'play-back';
>play-off
>sqlite> select * from dict where content match 'play-off';
>play-back
>sqlite> select * from dict where content match 'play off';
>play-off
>sqlite> select * from dict where content match 'play back';
>play-back
>
>
>Michael D. Black
>Senior Scientist
>Advanced Analytics Directorate
>Northrop Grumman Information Systems
>
>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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

Reply via email to