2008-10-06  Srinivasa Ragavan  <sragavan@novell.com>

	* camel/camel-folder-search.c: Allow thread based searches by falling
	back on the old in-memory search model.

Change backported for evolution-data-server-2.24.0.

--- evolution-data-server-2.24.0/camel/camel-folder-search.c
+++ evolution-data-server-2.24.0/camel/camel-folder-search.c
@@ -420,8 +420,8 @@
 	
 	p->ex = ex;
 
-	/* We route body-contains search and uid search through memory and not via db. */
-	if (uids || strstr((const char *) expr, "body-contains")) {
+	/* We route body-contains / thread based search and uid search through memory and not via db. */
+	if (strstr((const char *) expr, "body-contains") || strstr((const char *) expr, "match-threads")) {
 		/* setup our search list only contains those we're interested in */
 		search->summary = camel_folder_get_summary(search->folder);
 
