Do prefix-only searching in ContactStoreImpl to impove results
This commit is contained in:
parent
71cb7fcdfe
commit
3007ac51da
2 changed files with 3 additions and 3 deletions
|
|
@ -97,9 +97,9 @@ internal class Geary.ContactStoreImpl : BaseObject, Geary.ContactStore {
|
||||||
GLib.Cancellable? cancellable)
|
GLib.Cancellable? cancellable)
|
||||||
throws GLib.Error {
|
throws GLib.Error {
|
||||||
Gee.Collection<Contact> contacts = new Gee.LinkedList<Contact>();
|
Gee.Collection<Contact> contacts = new Gee.LinkedList<Contact>();
|
||||||
string normalised_query = query.make_valid().normalize();
|
string normalised_query = query.make_valid().normalize().down();
|
||||||
if (!String.is_empty(normalised_query)) {
|
if (!String.is_empty(normalised_query)) {
|
||||||
normalised_query = "%%%s%%".printf(normalised_query);
|
normalised_query = normalised_query + "%";
|
||||||
Db.Statement stmt = cx.prepare("""
|
Db.Statement stmt = cx.prepare("""
|
||||||
SELECT * FROM ContactTable
|
SELECT * FROM ContactTable
|
||||||
WHERE highest_importance >= ? AND (
|
WHERE highest_importance >= ? AND (
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ INSERT INTO ContactTable (
|
||||||
|
|
||||||
public void search_email_match() throws GLib.Error {
|
public void search_email_match() throws GLib.Error {
|
||||||
test_article.search.begin(
|
test_article.search.begin(
|
||||||
"example.com",
|
"Test@example",
|
||||||
0,
|
0,
|
||||||
10,
|
10,
|
||||||
null,
|
null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue