incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [5/8] git commit: Fixed the super query parsing.
Date Wed, 01 May 2013 02:45:27 GMT
Fixed the super query parsing.


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

Branch: refs/heads/0.1.5
Commit: 3f5e4280387e353592209c9a11360eb3d5904894
Parents: c905ca6
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Apr 30 22:43:19 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Apr 30 22:43:19 2013 -0400

----------------------------------------------------------------------
 .../org/apache/blur/manager/QueryParserUtil.java   |    2 -
 .../java/org/apache/blur/server/TableContext.java  |    2 +-
 .../org/apache/blur/manager/IndexManagerTest.java  |   38 +++++++--------
 3 files changed, 19 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/3f5e4280/src/blur-core/src/main/java/org/apache/blur/manager/QueryParserUtil.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/QueryParserUtil.java b/src/blur-core/src/main/java/org/apache/blur/manager/QueryParserUtil.java
index 651b435..4d12067 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/QueryParserUtil.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/QueryParserUtil.java
@@ -23,13 +23,11 @@ import org.apache.blur.lucene.search.SuperParser;
 import org.apache.blur.server.TableContext;
 import org.apache.blur.thrift.generated.BlurException;
 import org.apache.blur.thrift.generated.ScoreType;
-import org.apache.lucene.index.Term;
 import org.apache.lucene.queryparser.classic.ParseException;
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.FilteredQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.QueryWrapperFilter;
-import org.apache.lucene.util.Version;
 
 public class QueryParserUtil {
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/3f5e4280/src/blur-core/src/main/java/org/apache/blur/server/TableContext.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/server/TableContext.java b/src/blur-core/src/main/java/org/apache/blur/server/TableContext.java
index 4170c53..1427f1d 100644
--- a/src/blur-core/src/main/java/org/apache/blur/server/TableContext.java
+++ b/src/blur-core/src/main/java/org/apache/blur/server/TableContext.java
@@ -96,7 +96,7 @@ public class TableContext {
     tableContext.descriptor = tableDescriptor;
     tableContext.timeBetweenCommits = configuration.getLong(BLUR_SHARD_TIME_BETWEEN_COMMITS,
60000);
     tableContext.timeBetweenRefreshs = configuration.getLong(BLUR_SHARD_TIME_BETWEEN_REFRESHS,
5000);
-    tableContext.defaultPrimeDocTerm = new Term("_primedoc_", "true");
+    tableContext.defaultPrimeDocTerm = new Term("_prime_", "true");
     tableContext.defaultScoreType = ScoreType.SUPER;
 
     Class<?> c1 = configuration.getClass(BLUR_SHARD_INDEX_DELETION_POLICY_MAXAGE, KeepOnlyLastCommitDeletionPolicy.class);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/3f5e4280/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java b/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
index ebd8303..dfd9f27 100644
--- a/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
@@ -224,25 +224,24 @@ public class IndexManagerTest {
 
   private void setupData() throws BlurException, IOException {
     RowMutation mutation1 = newRowMutation(TABLE, "row-1",
-        newRecordMutation(FAMILY, "record-1", newColumn("testcol1", "value1"), newColumn("testcol2",
"value2"), newColumn("testcol3", "value3")));
+        newRecordMutation(FAMILY, "record-1",   newColumn("testcol1", "value1"), newColumn("testcol2",
"value2"), newColumn("testcol3", "value3")));
     RowMutation mutation2 = newRowMutation(TABLE, "row-2",
-        newRecordMutation(FAMILY, "record-2", newColumn("testcol1", "value4"), newColumn("testcol2",
"value5"), newColumn("testcol3", "value6")),
-        newRecordMutation(FAMILY, "record-2B", newColumn("testcol2", "value234123"), newColumn("testcol3",
"value234123")));
+        newRecordMutation(FAMILY, "record-2",   newColumn("testcol1", "value4"), newColumn("testcol2",
"value5"), newColumn("testcol3", "value6")),
+        newRecordMutation(FAMILY, "record-2B",  newColumn("testcol2", "value234123"), newColumn("testcol3",
"value234123")));
     RowMutation mutation3 = newRowMutation(TABLE, "row-3",
-        newRecordMutation(FAMILY, "record-3", newColumn("testcol1", "value7"), newColumn("testcol2",
"value8"), newColumn("testcol3", "value9")));
+        newRecordMutation(FAMILY, "record-3",   newColumn("testcol1", "value7"), newColumn("testcol2",
"value8"), newColumn("testcol3", "value9")));
     RowMutation mutation4 = newRowMutation(TABLE, "row-4",
-        newRecordMutation(FAMILY, "record-4", newColumn("testcol1", "value1"), newColumn("testcol2",
"value5"), newColumn("testcol3", "value9")),
-        newRecordMutation(FAMILY, "record-4B", newColumn("testcol2", "value234123"), newColumn("testcol3",
"value234123")));
-    RowMutation mutation5 = newRowMutation(
-        TABLE,
-        "row-5",
-        newRecordMutation(FAMILY, "record-5A", newColumn("testcol1", "value13"), newColumn("testcol2",
"value14"), newColumn("testcol3", "value15")),
-        newRecordMutation(FAMILY, "record-5B", newColumn("testcol1", "value16"), newColumn("testcol2",
"value17"), newColumn("testcol3", "value18"),
-            newColumn("testcol3", "value19")));
-    RowMutation mutation6 = newRowMutation(TABLE, "row-6", newRecordMutation(FAMILY, "record-6A",
newColumn("testcol12", "value110"), newColumn("testcol13", "value102")),
-        newRecordMutation(FAMILY, "record-6B", newColumn("testcol12", "value101"), newColumn("testcol13",
"value104")),
+        newRecordMutation(FAMILY, "record-4",   newColumn("testcol1", "value1"), newColumn("testcol2",
"value5"), newColumn("testcol3", "value9")),
+        newRecordMutation(FAMILY, "record-4B",  newColumn("testcol2", "value234123"), newColumn("testcol3",
"value234123")));
+    RowMutation mutation5 = newRowMutation(TABLE,"row-5",
+        newRecordMutation(FAMILY, "record-5A",  newColumn("testcol1", "value13"), newColumn("testcol2",
"value14"), newColumn("testcol3", "value15")),
+        newRecordMutation(FAMILY, "record-5B",  newColumn("testcol1", "value16"), newColumn("testcol2",
"value17"), newColumn("testcol3", "value18"), newColumn("testcol3", "value19")));
+    RowMutation mutation6 = newRowMutation(TABLE, "row-6", 
+        newRecordMutation(FAMILY, "record-6A",  newColumn("testcol12", "value110"), newColumn("testcol13",
"value102")),
+        newRecordMutation(FAMILY, "record-6B",  newColumn("testcol12", "value101"), newColumn("testcol13",
"value104")),
         newRecordMutation(FAMILY2, "record-6C", newColumn("testcol18", "value501")));
-    RowMutation mutation7 = newRowMutation(TABLE, "row-7", newRecordMutation(FAMILY, "record-7A",
newColumn("testcol12", "value101"), newColumn("testcol13", "value102")),
+    RowMutation mutation7 = newRowMutation(TABLE, "row-7", 
+        newRecordMutation(FAMILY, "record-7A",  newColumn("testcol12", "value101"), newColumn("testcol13",
"value102")),
         newRecordMutation(FAMILY2, "record-7B", newColumn("testcol18", "value501")));
     mutation7.waitToBeVisible = true;
     indexManager.mutate(mutation1);
@@ -258,8 +257,7 @@ public class IndexManagerTest {
   public void testQueryWithJoinAll() throws Exception {
     BlurQuery blurQuery = new BlurQuery();
     blurQuery.simpleQuery = new SimpleQuery();
-    blurQuery.simpleQuery.queryStr = "+test-family.testcol12:value101 +test-family.testcol13:value102
+test-family2.testcol18:value501";
-//    blurQuery.simpleQuery.queryStr = "+super:<+test-family.testcol12:value101 +test-family.testcol13:value102>
+test-family2.testcol18:value501";
+    blurQuery.simpleQuery.queryStr = "+super:<+test-family.testcol12:value101 +test-family.testcol13:value102>
+super:<test-family2.testcol18:value501>";
     
     blurQuery.simpleQuery.superQueryOn = true;
     blurQuery.simpleQuery.type = ScoreType.SUPER;
@@ -269,7 +267,7 @@ public class IndexManagerTest {
     blurQuery.uuid = 1;
 
     BlurResultIterable iterable = indexManager.query(TABLE, blurQuery, null);
-    assertEquals(iterable.getTotalResults(), 2);
+    assertEquals(iterable.getTotalResults(), 1);
     for (BlurResult result : iterable) {
       Selector selector = new Selector().setLocationId(result.getLocationId());
       FetchResult fetchResult = new FetchResult();
@@ -283,7 +281,7 @@ public class IndexManagerTest {
   public void testQueryWithJoin() throws Exception {
     BlurQuery blurQuery = new BlurQuery();
     blurQuery.simpleQuery = new SimpleQuery();
-    blurQuery.simpleQuery.queryStr = "+(+test-family.testcol12:value101 +test-family.testcol13:value102)
+test-family2.testcol18:value501";
+    blurQuery.simpleQuery.queryStr = "+super:<+test-family.testcol12:value101 +test-family.testcol13:value102>
+super:<test-family2.testcol18:value501>";
     blurQuery.simpleQuery.superQueryOn = true;
     blurQuery.simpleQuery.type = ScoreType.SUPER;
     blurQuery.fetch = 10;
@@ -306,7 +304,7 @@ public class IndexManagerTest {
   public void testQueryWithJoinForcingSuperQuery() throws Exception {
     BlurQuery blurQuery = new BlurQuery();
     blurQuery.simpleQuery = new SimpleQuery();
-    blurQuery.simpleQuery.queryStr = "+(+test-family.testcol1:value1 nojoin) +(+test-family.testcol3:value234123)";
+    blurQuery.simpleQuery.queryStr = "+super:<test-family.testcol1:value1> +super:<test-family.testcol3:value234123>";
     blurQuery.simpleQuery.superQueryOn = true;
     blurQuery.simpleQuery.type = ScoreType.SUPER;
     blurQuery.fetch = 10;


Mime
View raw message