incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [8/10] git commit: Small refector.
Date Tue, 29 Jan 2013 01:47:43 GMT
Small refector.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/d4de1ff1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/d4de1ff1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/d4de1ff1

Branch: refs/heads/0.2-dev
Commit: d4de1ff1fbb71f675025ad590194220ffccb3c8d
Parents: dd0805f
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Jan 28 20:43:33 2013 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Jan 28 20:43:33 2013 -0500

----------------------------------------------------------------------
 .../java/org/apache/blur/shell/SearchCommand.java  |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d4de1ff1/src/blur-shell/src/main/java/org/apache/blur/shell/SearchCommand.java
----------------------------------------------------------------------
diff --git a/src/blur-shell/src/main/java/org/apache/blur/shell/SearchCommand.java b/src/blur-shell/src/main/java/org/apache/blur/shell/SearchCommand.java
index 53ce82c..03ff0b8 100644
--- a/src/blur-shell/src/main/java/org/apache/blur/shell/SearchCommand.java
+++ b/src/blur-shell/src/main/java/org/apache/blur/shell/SearchCommand.java
@@ -28,6 +28,7 @@ import jline.Terminal;
 import jline.console.ConsoleReader;
 
 import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.BlurThriftUtil;
 import org.apache.blur.thrift.LongField;
 import org.apache.blur.thrift.StringField;
 import org.apache.blur.thrift.TextField;
@@ -38,7 +39,6 @@ import org.apache.blur.thrift.generated.Field;
 import org.apache.blur.thrift.generated.Query;
 import org.apache.blur.thrift.generated.QueryArgs;
 import org.apache.blur.thrift.generated.QueryType;
-import org.apache.blur.thrift.generated.ScoreDoc;
 import org.apache.blur.thrift.generated.Session;
 import org.apache.blur.thrift.generated.TYPE;
 import org.apache.blur.thrift.generated.TopFieldDocs;
@@ -129,11 +129,8 @@ public class SearchCommand extends TableSingleArgumentCommand {
     }
 
     TopFieldDocs topFieldDocs = topDocs.iterator().next();
-    List<ScoreDoc> scoreDocs = topFieldDocs.getScoreDocs();
-    List<Long> docLocations = new ArrayList<Long>();
-    for (ScoreDoc scoreDoc : scoreDocs) {
-      docLocations.add(scoreDoc.getDocLocation());
-    }
+    List<Long> docLocations = BlurThriftUtil.toDocLocations(topFieldDocs);
+    
     List<Document> docs;
     if (fieldNames != null && fieldNames.length > 0) {
       docs = client.doc(session, docLocations, new HashSet<String>(Arrays.asList(fieldNames)));


Mime
View raw message