home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 620170826

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/743#issuecomment-620170826 https://api.github.com/repos/simonw/datasette/issues/743 620170826 MDEyOklzc3VlQ29tbWVudDYyMDE3MDgyNg== 9599 2020-04-27T18:58:04Z 2020-04-27T18:58:04Z OWNER

Maybe this is moot because you can't store a * character in a FTS table anyway, so it would never make sense to search for one? In which case maybe escape_fts() should just strip out * entirely?

Best source of information I could find was this tiny thread from 2014 about FTS4:

http://sqlite.1065341.n5.nabble.com/Escaping-conventions-for-FTS4-virtual-table-queries-td74589.html

Dave Baggett wrote:

What if I want docids of documents containing the exact literal token "any*"?

You would have to use one of the Unicode tokenizers, and configure it to interpret * as a token character.

how do I escape the asterisk so that it's not interpreted as a wildcard?

There are no escapes. When * is a token character, you lose the ability to do prefix searches.

I could investigate further by learning to use the fts5vocab virtual table debugging tool to see what's actually stored in those FTS5 indexes and check if * is indeed stripped by them.

https://www.sqlite.org/fts5.html#the_fts5vocab_virtual_table_module

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
607770595  
Powered by Datasette · Queries took 1.035ms · About: github-to-sqlite