History log of /packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
116d86ddd67330428f9128613b4886fc0ea66221 27-Apr-2012 Makoto Onuki <omakoto@google.com> Make names with special chars searchable.

It's a better fix than I34bfa864, which was only a quick workaround for double
barrelled names.

Now names with other special characters are searchable too.

Also, previously, a query "doublebarrelled" wouldn't match "double-barrelled",
but now it will.

Bug 5592553

Change-Id: Id1d44261f577df7abf701311ed1c86fb093547da
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
0992b9d4969ed0eee6e879db94292b635229e2b7 11-Apr-2012 Makoto Onuki <omakoto@google.com> New aggregation logic

Now a raw contact can be merged into a contact containing raw contacts from
the same account if there's at least one raw contact in those raw contacts
that shares at least one email address, phone number, or identity.

Now the aggregation logic version is 3.

Also:
- Make sure changes to the identity triggers aggregation.

- Stop re-using some HashMaps/HashSets, as they don't shirink the internal
table when clear()ed. During the aggregation update we may put a bunch of
stuff into those, and we want to make sure that we don't keep unnecessarily
bit internal tables after the upgrade. This should be okay with the modern
dalvik GC.

Change-Id: I855085d334679363cf9bffb918ca2ceb0cfe77f5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
565b62f354d8b6aadc760092a7dbf483f8bbbe17 08-Mar-2012 Makoto Onuki <omakoto@google.com> Use wall time instead of CPU time for performance log

Apparently what currentThreadTimeMillis() returns is the CPU time,
not wall time, which is not really interesting when we measure
performance. Use the actual wall time instead.

Change-Id: Ibe2e385ff1bdeeb1128a584c79925210dde5525a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
7e086471c6317d059af21d292bee964b24613346 19-Jan-2012 Makoto Onuki <omakoto@google.com> Speed up search query update after each transaction

Contains two optimizations, which will greatly affect initial sync for
an account with a large number of contacts.

- When selecting from search_index, we used two columns from different tables:
'raw_contacts.contact_id IN (...) OR data.raw_contact_id IN (...)'.
But this is really equivalent to
'... OR raw_contacts._id IN (...)' as we inner join the two tables.

The latter is pretty much faster as both columns are in the same table and
each has an index.

Bug 5842620

- When we replace a search_index row, we first try UPDATE and if no rows are
affected then INSERT. But this UPDATE is pretty slow; on a test device it can
easily take >10ms, and with a 10K contacts database it took >80ms. (INSERT
is pretty fast; it's typically ~1ms.)

Let's first bulk DELETE all affected rows, then INSERT. The DELETE takes
roughly the same time as the previous UPDATE, but we only need 1 DELETE
per transaction, not per row contact.

Bug 5887648

Change-Id: I549ea2b47d7058bfba96a861236295f682d88c10
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
f5f038faf7f3ef460e1c11028d467954840e5f6f 14-Nov-2011 Makoto Onuki <omakoto@google.com> Fix search for hyphenated names

This issue was caused by the combination of the fact that we have two
different imcompatible tokenizers for names, and the fact that our
name-normalizer ignroes all non-letter and non-digit characters.

Basically, the name tokenizer used to build index uses ' ' as the separator,
and the one used to tokenize queries use all non-letter, non-digit characters.

Take the name "Double-barrelled" as an example. The full-text search index
for this looks like "doublebarrelled", because it's treated as one token
(because there's no spaces in it), and the normalzier removes all
non-letter/digits.

On the other hand, the query term "double-barrelled" will be split into
"double" "barrelled", and internally it becomes AND-ed prefix matches
"double* AND barrelled*". Beacuse "barrelled*" doesn't match "doublebarrelled"
the query doesn't hit.

So (for now) let's split names with '-' when buidling the index. With this
CL the index will be "double barrelled" and the query "double-barrelled"
(and also "double barrelled") *will* hit this.

Long-term we probably need a better fix.

Bug 5592553

Change-Id: I34bfa8647eec8d203f8ff7fc8a85f42505054c7c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
d1746e09bc7739f3d1449cececc66d5045ada498 15-Oct-2011 Daniel Lehmann <lehmannd@google.com> Use hexadecimal collation key for name searches.

Also allow prefix search on name

Bug:5337763

Change-Id: I039264be0c8309224d8925ded06ab02a64a5ce1b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
8f79445f450755858a88e8a5a0e14d81a0b9ff87 21-Sep-2011 Daisuke Miyakawa <dmiyakawa@google.com> Make search aware of names in "all other contacts"

default_directory doesn't contain contacts which are in
"all other contacts" group (or people who are not in any group),
while in search mode we want those names.

Bug: 5336673
Change-Id: Ib77acdfa6968605a66561f0925d0aa81f4522bb9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
155accbcb95fc13b984cf0ea8e5498a9c619cbf5 12-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: email suggestions

Also, removing a bunch of dead code

Bug: 2078420
Change-Id: I2c0a9ddd8e60624049b39ac018f87bfabc6574c2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
174f7d319b987aa2aeeb6f2563f4b939acb8d791 11-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: QSB support

Bug: 2078420
Change-Id: I767ccecc856c0ae9ad74aafb3dac0de39b657e3c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
197411a6cc3f81b94a34ca207f267d43d8548f04 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: removing organization from name lookup

It no longer needs to be in the name lookup table,
because we now have it in the search index and we
don't use it for aggregation.

Bug: 2078420
Change-Id: Iaab128513ff29a38f97c7d880c2aae668a3ef865
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
bd9abbb6b03b4ec1e28ad3fa2fcba5d1eb8609ea 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: updating search index on change of visibility

When a contact becomes invisible, the search index will
be cleared. When it becomes visible, the index will be
built.

Bug: 2078420
Change-Id: I1eea88d3d9babc891d112d15d9041d01c383f22f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
f482a4e25759d2c144eb41a3de56a342bd473435 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: no snippet when searching by name

Bug: 2078420
Change-Id: Icdd38c9963accec117ce134ef5a13e08e5f07f05
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
05e50fbf9809bf04eceec3d2a2753630dc4f9315 09-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: building full index for all contacts

Bug: 2078420
Change-Id: Ief6db4f4ecc0b6e5adb37a0654a72383099dc138
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
6d9702cec82fd27a1c3093c64df9dcc22744899a 09-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: adding remaining built-in data types

Bug: 2078420
Change-Id: Ifbd67f5ed65c44c2521a4b4d48d90aab8d0c86d1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
eeeed5669d98897501bf2b18c88579c7effd0955 08-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: adding common data types

Bug: 2078420
Change-Id: I0c48e1fef3473415d01280274599f0be5cc69b08
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java
f262d56495ac4ea30d31bd050efb116bd4bb4235 08-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: adding internal provider API.

Also, adding the very first data type to FTS: organization.


Bug: 2078420
Change-Id: I64d6f6a63efc838c4c2c80d4311bcc23bae23a67
/packages/providers/ContactsProvider/src/com/android/providers/contacts/SearchIndexManager.java