Re: [sqlite] Building an fts Query for Double Quote

2012-06-19 Thread nobre
With the default tokenizer your index would split such an input (quot'ed)
into 'quot' and 'ed' , you wouldn't get a hit for a phrase such as
"quot''ed".
If you use a custom tokenizer , you CAN use " in your terms/queries, however
it won't work for phrases, only for single tokens

>From the fts3aux.c source:
/* See if we are dealing with a quoted phrase. If this is the case, then
  ** search for the closing quote and pass the whole string to
getNextString()
  ** for processing. This is easy to do, as fts3 has no syntax for escaping
  ** a quote character embedded in a string.
  */

--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Building-an-fts-Query-for-Double-Quote-tp62541p62545.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building an fts Query for Double Quote

2012-06-18 Thread Carl Desautels
On Mon, Jun 18, 2012 at 12:57 PM, Richard Hipp  wrote:

> Double-quote is syntactically significant to FTS3 - it delimits two or more
> word in a phrase search.  You cannot search for words that contain
> double-quote using FTS3.
>

Thank you

-- 
Carlin W. Desautels
Research Assistant
Seneca's Centre for Development of Open Technology
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building an fts Query for Double Quote

2012-06-18 Thread Richard Hipp
On Mon, Jun 18, 2012 at 12:10 PM, Carl Desautels <
carlin.desaut...@senecacollege.ca> wrote:

> Hi,
>
> I'm using SQLite 3.7.12 and I'm trying to build an fts phrase query to
> match a string containing a double-quote.
>

Double-quote is syntactically significant to FTS3 - it delimits two or more
word in a phrase search.  You cannot search for words that contain
double-quote using FTS3.


>
> Given the table created by the following commands:
>
>   - create virtual table tbl using fts4(txt);
>   - insert into tbl values ('quot"ed'), ('quoted');
>
> I have tried to search for "quot"ed" in the following ways and provided
> their respective errors:
>
>   - match('"*\"*"')
>  - Error: malformed MATCH expression: ["*\"*"]
>  - match('"*"*"')
>  - Error: malformed MATCH expression: ["*"*"]
>   - match('"*\\"*"')
>  - Error: malformed MATCH expression: ["*\\"*"]
>   - match('"*\\\"*"')
>  - Error: malformed MATCH expression: ["*\\\"*"]
>
> --
> Carlin W. Desautels
> Research Assistant
> Seneca's Centre for Development of Open Technology
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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