androidsqlsqlitefts3

How to write contains query in SQLite fts3 fulltext search


I want to make fulltext search in my index table which is sqlite fts3.

For example; the data set is { "David Luiz", "David Villa", "Diego Costa", "Diego Ribas", "Diego Milito","Gabriel Milito", }

When I type "vid i" I want to get {"David Luiz", "David Villa"}

In documentation of SQLite I found this http://www.sqlite.org/fts3.html#section_3 but it contains just startswith query.

my query is:
   SELECT *FROM Table WHERE Table MATCH "*vid* *i*"

I dont know it is possible or not. If it is possible to make search in sqlite fts3, any help will be appreciated


Solution

  • The FTS index is optimized for word searches, and supports word prefix searches.

    There is no index that can help with searches inside words. You have to use LIKE '%vid%' (which scans the entire table).