incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Adding a cluster test for the terms call as well as allowing for a null value in the startsWith field that can be used instead of an empty string.
Date Wed, 11 Sep 2013 00:02:54 GMT
Updated Branches:
  refs/heads/master 47124decc -> c16371dff


Adding a cluster test for the terms call as well as allowing for a null value in the startsWith
field that can be used instead of an empty string.


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

Branch: refs/heads/master
Commit: c16371dffaaba3b68881f6d2335d6c749d01517d
Parents: 47124de
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Sep 10 20:01:54 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Sep 10 20:01:54 2013 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/blur/manager/IndexManager.java  |  3 +++
 .../java/org/apache/blur/thrift/BlurClusterTest.java     | 11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c16371df/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java b/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
index 9184219..477c238 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
@@ -715,6 +715,9 @@ public class IndexManager {
 
   public static List<String> terms(IndexReader reader, String columnFamily, String
columnName, String startWith,
       short size) throws IOException {
+    if (startWith == null) {
+      startWith = "";
+    }
     Term term = getTerm(columnFamily, columnName, startWith);
     List<String> terms = new ArrayList<String>(size);
     AtomicReader areader = BlurUtil.getAtomicReader(reader);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c16371df/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java b/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
index dac5851..d0743ad 100644
--- a/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
+++ b/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
@@ -150,7 +150,7 @@ public class BlurClusterTest {
     BlurResults resultsRecord = client.query("test", blurQueryRecord);
     assertRecordResults(resultsRecord);
     assertEquals(length, resultsRecord.getTotalResults());
-    
+
     Schema schema = client.schema("test");
     assertFalse(schema.getFamilies().isEmpty());
   }
@@ -306,6 +306,15 @@ public class BlurClusterTest {
 
   }
 
+  @Test
+  public void testTermsList() throws BlurException, TException {
+    Iface client = getClient();
+    List<String> terms = client.terms("test", "test", "test", null, (short) 10);
+    List<String> list = new ArrayList<String>();
+    list.add("value");
+    assertEquals(list, terms);
+  }
+
   private void assertRowResults(BlurResults results) {
     for (BlurResult result : results.getResults()) {
       assertNull(result.locationId);


Mime
View raw message