Contenu connexe Similaire à Mateusz herych content search problem on android (20) Mateusz herych content search problem on android14. Sure, some apps don’
t really need it
You need an Internet to order
that taxi anyway
15. Do you keep offline
content?
Let your users navigate fast.
26. I tried to put all the
conditions that need to be
satisfied so SQLite can use
indices combined with LIKE
operator.
Docs saying
33. EXPLAIN QUERY PLAN
SELECT id FROM deals WHERE
name LIKE ‘Some%’;
SEARCH TABLE deals USING COVERING
INDEX search_index (name>? AND name<?)
(~31250 rows)
37. first_name || ‘ ‘ || last_name?
complicated queries, VIEWs?
Like is NOT the way
to go.
46. What is virtual table?
Imagine it’s a Java interface.
interface VirtualTable {
void insert(Params p);
void update(Params p);
// etc, also createTable.
}
47. What is a virtual table?
class Fts3 implements VirtualTable {
// …
}
51. SELECT rowid, * FROM search
WHERE content MATCH
‘something’
rowid|word
1|something
2|not something special
3|SoMeThInG
52. SELECT rowid, * FROM search
WHERE content
MATCH ‘some* spe*’
rowid|word
2|not something special
54. SELECT * FROM search WHERE
lyrics
MATCH ‘author:Giorgio Synthesizer
author |lyrics
Giorgio Moroder|..Why don’t I use a
synthesizer...
57. SELECT * FROM search WHERE
lyrics
MATCH ‘why NEAR synthesizer’
author |lyrics
Giorgio Moroder|..Why don’t I use
synthesizer...
58. SELECT * FROM search WHERE
lyrics
MATCH ‘why NEAR/3 synthesizer’
author |lyrics
Giorgio Moroder|..Why don’t I use
synthesizer...
60. 1. Your FTS vtable should contain
only tokens. Divided into sections.
61. 2. Link your FTS table’s records
with other table (containing real
object’s id and type) using rowid.
62. 3. Remember. FTS is fast enough
for searching purposes. But it’s
always slower than ‘=’ based query
on indexed field.
63. 4. EXPLAIN QUERY PLAN doesn’t
work for fts tables. Try to measure
it with .timer ON.