From: Randy Baumgarte Date: Thu, 17 Feb 2011 21:09:33 +0000 (-0500) Subject: Correct missing wildcard logic. X-Git-Tag: version0.1.1~200 X-Git-Url: http://git.sourceforge.jp/view?p=neighbornote%2FNeighborNote.git;a=commitdiff_plain;h=938b09788d906b7231dafb15357453c88b017efe;hp=b2a6dabd0ba95ce8da98de264d04b4c75f913690 Correct missing wildcard logic. --- diff --git a/src/cx/fbn/nevernote/sql/REnSearch.java b/src/cx/fbn/nevernote/sql/REnSearch.java index 059548e..6079515 100644 --- a/src/cx/fbn/nevernote/sql/REnSearch.java +++ b/src/cx/fbn/nevernote/sql/REnSearch.java @@ -710,14 +710,20 @@ public class REnSearch { NSqlQuery mergeQuery = new NSqlQuery(conn.getConnection()); NSqlQuery deleteQuery = new NSqlQuery(conn.getConnection()); - indexQuery.prepare("Select distinct guid from words where weight >= " +minimumRecognitionWeight + - " and word=:word"); insertQuery.prepare("Insert into SEARCH_RESULTS (guid) values (:guid)"); mergeQuery.prepare("Insert into SEARCH_RESULTS_MERGE (guid) values (:guid)"); if (subSelect) { for (int i=0; i= " +minimumRecognitionWeight + + " and word=:word"); + indexQuery.bindValue(":word", getWords().get(i)); + } else { + indexQuery.prepare("Select distinct guid from words where weight >= " +minimumRecognitionWeight + + " and word like :word"); + indexQuery.bindValue(":word", getWords().get(i).replace("*", "%")); + } indexQuery.exec(); String guid = null; while(indexQuery.next()) {