On Sep 2, 2010, at 6:37 PM, Lukas Haase wrote: > Hi, > > I use FTS3 (SQLITE_ENABLE_FTS3) with enhanced query syntax > (SQLITE_ENABLE_FTS3_PARENTHESIS). > > Now if I search for a string like '2002/91/AH' there are lots of items > which do NOT contain this string. This is a query: > > SELECT rowid, content FROM fulltext WHERE content MATCH '2002/91/AH'; > > In my case, there are only 10 items which actually contain the string > '2002/91/AH' but the query above gives me 162 (!) matches! > > I can not find any reason for this. Some of the topics contain > "similar" > strings like 2002/96/AH or even 94/31/EG. But in fact, these strings > must not be matched :-( > > Does the slash have a special meaning in the query syntax? Does a > query > like 2002/91/AH have a special meaning?
The '/' characters are serving as token separators. So you are searching for (2002 OR 91 OR ah). If you enclose the date in double quotes: ... MATCH '"2002/91/AH"' you will be searching for the phrase "2002 91 ah", which is as close as you can get to what you want without writing a custom tokenizer: http://www.sqlite.org/fts3.html#section_5_1 _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

