diff query.cpp @ 466:11fccb6a3bd5 api-inversion

Almost there! audioDB::index_query_loop is now set, except for the lsh_in_core and lsh_exact flags. I think the plan is to zap lsh_in_core entirely, and add some flags to the qid structure for indexed behaviour.
author mas01cr
date Wed, 31 Dec 2008 12:25:22 +0000
parents 1030664df98c
children 4dbd7917bf9e
line wrap: on
line diff
--- a/query.cpp	Tue Dec 30 23:56:57 2008 +0000
+++ b/query.cpp	Wed Dec 31 12:25:22 2008 +0000
@@ -228,9 +228,10 @@
   // Test for index (again) here
   if((qspec.refine.flags & ADB_REFINE_RADIUS) && audiodb_index_exists(adb->path, qspec.refine.radius, qspec.qid.sequence_length)){ 
     VERB_LOG(1, "Calling indexed query on database %s, radius=%f, sequence_length=%d\n", adb->path, qspec.refine.radius, qspec.qid.sequence_length);
-    index_query_loop(adb, &qspec, &qstate);
-  }
-  else {
+    if(index_query_loop(adb, &qspec, &qstate) < 0) {
+      error("index_query_loop failed");
+    }
+  } else {
     VERB_LOG(1, "Calling brute-force query on database %s\n", dbName);
     if(audiodb_query_loop(adb, &qspec, &qstate)) {
       error("audiodb_query_loop failed");