OSDN Git Service

Move index scanning to separate thread to increase performance.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / NoteResourceTable.java
index 6acc357..2c262cf 100644 (file)
@@ -108,6 +108,23 @@ public class NoteResourceTable  {
                }       \r
                return guids;   \r
        }\r
+       // get any unindexed resource\r
+       public List<String> getUnindexed() {\r
+               List<String> guids = new ArrayList<String>();\r
+        NSqlQuery query = new NSqlQuery(db.getConnection());\r
+                                       \r
+               if (!query.exec("Select guid from NoteResources where indexNeeded = true"))\r
+                       logger.log(logger.EXTREME, "NoteResources SQL retrieve has failed on getUnindexed(): " +query.lastError());\r
+\r
+               // Get a list of the notes\r
+               String guid;\r
+               while (query.next()) {\r
+                       guid = new String();\r
+                       guid = query.valueString(0);\r
+                       guids.add(guid);\r
+               }       \r
+               return guids;   \r
+       }\r
 \r
        public List<String> findInkNotes() {\r
                List<String> guids = new ArrayList<String>();\r