diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/lucence/common/Searcher.java b/acs/nladmin-system/src/main/java/org/nl/modules/lucence/common/Searcher.java index 9e1348b..2cbc797 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/lucence/common/Searcher.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/lucence/common/Searcher.java @@ -10,7 +10,6 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; import org.apache.lucene.util.BytesRef; -import org.nl.modules.lucence.common.LuceneIndexWriter; import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.search.*; import org.apache.lucene.store.Directory; @@ -97,10 +96,11 @@ public class Searcher { ScoreDoc[] scoreDocs = docs.scoreDocs; if (end > docs.totalHits.value) end = (int) docs.totalHits.value; JSONArray array = new JSONArray(); - JSONObject object = new JSONObject(); + for (int i = start; i < end; i++) { ScoreDoc scoreDoc = scoreDocs[i]; Document doc = reader.document(scoreDoc.doc); + JSONObject object = new JSONObject(); object.put("content",doc.get("fieldContent")); object.put("device_code",doc.get("device_code")); object.put("logTime",doc.get("logTime"));