diff OrthancServer/ServerContext.cpp @ 3204:8792867b739a

fix incorrect "too many results"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Feb 2019 16:46:08 +0100
parents 574890d14c92
children f509d3c6d570
line wrap: on
line diff
--- a/OrthancServer/ServerContext.cpp	Wed Feb 06 15:45:16 2019 +0100
+++ b/OrthancServer/ServerContext.cpp	Wed Feb 06 16:46:08 2019 +0100
@@ -834,11 +834,13 @@
 
     std::vector<std::string> resources, instances;
 
-    const size_t lookupLimit = (databaseLimit == 0 ? 0 : databaseLimit + 1);      
-    GetIndex().ApplyLookupResources(resources, &instances, lookup, queryLevel, lookupLimit);
+    {
+      const size_t lookupLimit = (databaseLimit == 0 ? 0 : databaseLimit + 1);      
+      GetIndex().ApplyLookupResources(resources, &instances, lookup, queryLevel, lookupLimit);
+    }
 
     bool complete = (databaseLimit == 0 ||
-                     resources.size() > databaseLimit);
+                     resources.size() <= databaseLimit);
 
     LOG(INFO) << "Number of candidate resources after fast DB filtering on main DICOM tags: " << resources.size();