  		return GNOME_Evolution_Addressbook_Success;
  	} else {
  		g_warning (G_STRLOC ": db->put failed with %s", db_strerror (db_error));
-@@ -642,11 +648,44 @@
+@@ -642,11 +648,45 @@
  	d(printf ("signalling parent thread\n"));
  	e_flag_set (closure->running);
  
 -	if (e_book_backend_summary_is_summary_query (bf->priv->summary, query)) {
-+
 +	g_debug (G_STRLOC ": Query is %s", query);
 +	if (e_book_backend_file_index_is_usable (bf->priv->index, query))
 +	{
 +		GPtrArray *ids = NULL;
 +		int i;
++
++		g_debug (G_STRLOC ": Using index for %s", query);
 +
 +		ids = e_book_backend_file_index_query (bf->priv->index, query);
 +

 		for (i = 0; i < ids->len; i ++) {
 			char *id = g_ptr_array_index (ids, i);
 
@@ -668,8 +707,7 @@
 		}
 
 		g_ptr_array_free (ids, TRUE);

 		/* iterate over the db and do the query there */
 		DBC    *dbc;
 
@@ -709,13 +748,14 @@
 				   bf->priv->filename);
 			abort ();
 		}
