incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [28/28] git commit: Initial commit of the back port. The blur-util, blur-store, have been completed. Also a new distribution project help with the building of the project. Also all of the pom files have been updated to the new version. This is very m
Date Mon, 18 Mar 2013 01:10:30 GMT
Updated Branches:
  refs/heads/0.1.5 b89d45641 -> a46014229


Initial commit of the back port.  The blur-util, blur-store, have been completed.  Also a new distribution project help with the building of the project.  Also all of the pom files have been updated to the new version.  This is very much a work in progress, and at this point it will be difficult to create discrete tasks to complete the transition.  More to come.


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

Branch: refs/heads/0.1.5
Commit: a46014229cbafcd88f6f84bbca22926b92034545
Parents: cac5fb7
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Sun Mar 17 21:06:21 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Sun Mar 17 21:06:21 2013 -0400

----------------------------------------------------------------------
 src/blur-core/pom.xml                              |   58 +-
 src/blur-demo/pom.xml                              |    2 +-
 src/blur-gui/pom.xml                               |   67 +-
 src/blur-jdbc/pom.xml                              |    2 +-
 src/blur-mapred/pom.xml                            |   54 +-
 src/blur-query/pom.xml                             |  137 +
 .../blur/lucene/search/AbstractWrapperQuery.java   |  106 +
 .../org/apache/blur/lucene/search/FacetQuery.java  |  200 +
 .../apache/blur/lucene/search/PrimeDocCache.java   |  100 +
 .../org/apache/blur/lucene/search/ScoreType.java   |   22 +
 .../org/apache/blur/lucene/search/SlowQuery.java   |  137 +
 .../blur/lucene/search/StopExecutionCollector.java |   67 +
 .../org/apache/blur/lucene/search/SuperParser.java |   79 +
 .../org/apache/blur/lucene/search/SuperQuery.java  |  316 +
 .../lucene/serializer/AbtractQueryWritable.java    |   40 +
 .../lucene/serializer/BooleanClauseWritable.java   |   87 +
 .../lucene/serializer/BooleanQueryWritable.java    |   78 +
 .../blur/lucene/serializer/FuzzyQueryWritable.java |  110 +
 .../org/apache/blur/lucene/serializer/IOUtil.java  |   30 +
 .../serializer/MatchAllDocsQueryWritable.java      |   40 +
 .../blur/lucene/serializer/ProtoSerializer.java    |   88 +
 .../blur/lucene/serializer/QueryWritable.java      |   74 +
 .../lucene/serializer/QueryWritableMapper.java     |   81 +
 .../blur/lucene/serializer/SerializerUtil.java     |   53 +
 .../blur/lucene/serializer/SuperQueryWritable.java |   60 +
 .../blur/lucene/serializer/TermQueryWritable.java  |   67 +
 .../blur/lucene/serializer/TermWritable.java       |   62 +
 .../lucene/serializer/WildcardQueryWritable.java   |   61 +
 .../apache/blur/lucene/search/FacetQueryTest.java  |  105 +
 .../apache/blur/lucene/search/SuperParserTest.java |  131 +
 .../blur/lucene/serializer/QueryWritableTest.java  |   38 +
 .../apache/blur/search/RandomSuperQueryTest.java   |  152 +
 .../org/apache/blur/search/SuperQueryTest.java     |  199 +
 src/blur-store/pom.xml                             |   57 +-
 .../java/org/apache/blur/index/IndexWriter.java    |   26 +
 .../apache/blur/index/OptimisticLockFactory.java   |  102 +
 .../java/org/apache/blur/lucene/EscapeRewrite.java |  334 -
 .../org/apache/blur/lucene/LuceneConstant.java     |   25 -
 .../apache/blur/lucene/LuceneVersionConstant.java  |   28 +
 .../refcounter/DirectoryReferenceCounter.java      |  282 +
 .../store/refcounter/DirectoryReferenceFileGC.java |  114 +
 .../lucene/store/refcounter/IndexInputCloser.java  |   80 +
 .../java/org/apache/blur/store/BufferStore.java    |  113 -
 .../blur/store/CustomBufferedIndexInput.java       |  277 -
 .../apache/blur/store/blockcache/BlockCache.java   |   51 +-
 .../blur/store/blockcache/BlockDirectory.java      |  104 +-
 .../blur/store/blockcache/BlockDirectoryCache.java |   36 +-
 .../apache/blur/store/blockcache/BlockLocks.java   |    5 +-
 .../org/apache/blur/store/blockcache/Cache.java    |   31 +-
 .../blur/store/blockcache/CachedIndexOutput.java   |   88 +
 .../org/apache/blur/store/buffer/BufferStore.java  |  126 +
 .../store/buffer/ReusedBufferedIndexInput.java     |  361 +
 .../store/buffer/ReusedBufferedIndexOutput.java    |  189 +
 .../compressed/CompressedFieldDataDirectory.java   |  813 -
 .../apache/blur/store/hdfs/BlurLockFactory.java    |  110 +
 .../org/apache/blur/store/hdfs/ChangeFileExt.java  |   38 -
 .../apache/blur/store/hdfs/ConvertDirectory.java   |   62 -
 .../apache/blur/store/hdfs/CopyFromHdfsLocal.java  |   48 -
 .../org/apache/blur/store/hdfs/HdfsDirectory.java  |  515 +-
 .../org/apache/blur/store/hdfs/HdfsFileReader.java |  188 -
 .../org/apache/blur/store/hdfs/HdfsFileWriter.java |   99 -
 .../org/apache/blur/store/hdfs/HdfsMetaBlock.java  |   61 -
 .../apache/blur/store/hdfs/NullIndexOutput.java    |   70 -
 .../apache/blur/store/lock/BlurLockFactory.java    |  102 -
 .../apache/lucene/index/WarmUpByFieldBounds.java   |  217 -
 .../lucene/index/WarmUpByFieldBoundsStatus.java    |   25 -
 .../org/apache/blur/store/BenchmarkDirectory.java  |  148 -
 .../apache/blur/store/BenchmarkDirectoryNrt.java   |  160 -
 .../org/apache/blur/store/HdfsDirectoryTest.java   |   31 +-
 .../java/org/apache/blur/store/UsingHdfsDir.java   |  112 -
 .../blur/store/blockcache/BlockCacheTest.java      |   43 +-
 .../store/blockcache/BlockDirectoryCacheTest.java  |   38 +
 .../blur/store/blockcache/BlockDirectoryTest.java  |  128 +-
 .../CompressedFieldDataDirectoryTest.java          |  143 -
 src/blur-testsuite/pom.xml                         |   45 +-
 src/blur-thrift/pom.xml                            |   34 +-
 .../generated/AlternateColumnDefinition.java       |  141 +-
 .../blur/thrift/generated/AnalyzerDefinition.java  |  278 +-
 .../org/apache/blur/thrift/generated/Blur.java     | 9130 ++++--
 .../blur/thrift/generated/BlurException.java       |  178 +-
 .../apache/blur/thrift/generated/BlurQuery.java    |  738 +-
 .../blur/thrift/generated/BlurQueryStatus.java     |  399 +-
 .../apache/blur/thrift/generated/BlurResult.java   |  227 +-
 .../apache/blur/thrift/generated/BlurResults.java  |  543 +-
 .../org/apache/blur/thrift/generated/Column.java   |  176 +-
 .../blur/thrift/generated/ColumnDefinition.java    |  282 +-
 .../thrift/generated/ColumnFamilyDefinition.java   |  243 +-
 .../blur/thrift/generated/ColumnPreCache.java      |  190 +-
 .../org/apache/blur/thrift/generated/CpuTime.java  |  189 +-
 .../apache/blur/thrift/generated/ExpertQuery.java  |  176 +-
 .../org/apache/blur/thrift/generated/Facet.java    |  186 +-
 .../blur/thrift/generated/FetchRecordResult.java   |  182 +-
 .../apache/blur/thrift/generated/FetchResult.java  |  306 +-
 .../blur/thrift/generated/FetchRowResult.java      |  147 +-
 .../apache/blur/thrift/generated/QueryState.java   |    3 +-
 .../org/apache/blur/thrift/generated/Record.java   |  263 +-
 .../blur/thrift/generated/RecordMutation.java      |  182 +-
 .../blur/thrift/generated/RecordMutationType.java  |    3 +-
 .../java/org/apache/blur/thrift/generated/Row.java |  273 +-
 .../apache/blur/thrift/generated/RowMutation.java  |  381 +-
 .../blur/thrift/generated/RowMutationType.java     |    3 +-
 .../org/apache/blur/thrift/generated/Schema.java   |  283 +-
 .../apache/blur/thrift/generated/ScoreType.java    |    3 +-
 .../org/apache/blur/thrift/generated/Selector.java |  520 +-
 .../apache/blur/thrift/generated/SimpleQuery.java  |  291 +-
 .../blur/thrift/generated/TableDescriptor.java     |  644 +-
 .../apache/blur/thrift/generated/TableStats.java   |  300 +-
 src/blur-util/pom.xml                              |   97 +-
 .../src/main/java/org/apache/blur/CachedMap.java   |   63 +
 .../java/org/apache/blur/concurrent/Executors.java |    9 +-
 .../org/apache/blur/metrics/AtomicLongGauge.java   |   24 +
 .../org/apache/blur/metrics/MetricsConstants.java  |   25 +
 .../org/apache/blur/zookeeper/WatchChildren.java   |    9 +-
 .../org/apache/blur/zookeeper/ZkCachedMap.java     |  225 +
 src/distribution/pom.xml                           |   53 +
 src/distribution/src/assemble/bin.xml              |   36 +
 src/distribution/src/main/scripts/bin/blur         |   26 +
 .../src/main/scripts/bin/blur-config.sh            |  104 +
 .../src/main/scripts/bin/controllers.sh            |   34 +
 src/distribution/src/main/scripts/bin/shards.sh    |   34 +
 src/distribution/src/main/scripts/bin/start-all.sh |   24 +
 .../main/scripts/bin/start-controller-server.sh    |   41 +
 .../src/main/scripts/bin/start-controllers.sh      |   24 +
 .../src/main/scripts/bin/start-shard-server.sh     |   43 +
 .../src/main/scripts/bin/start-shards.sh           |   25 +
 src/distribution/src/main/scripts/bin/stop-all.sh  |   24 +
 .../src/main/scripts/bin/stop-controller-server.sh |   38 +
 .../src/main/scripts/bin/stop-controllers.sh       |   24 +
 .../src/main/scripts/bin/stop-shard-server.sh      |   38 +
 .../src/main/scripts/bin/stop-shards.sh            |   24 +
 src/distribution/src/main/scripts/conf/blur-env.sh |   56 +
 .../src/main/scripts/conf/blur-site.properties     |   21 +
 src/distribution/src/main/scripts/conf/controllers |    1 +
 .../main/scripts/conf/hadoop-metrics.properties    |   28 +
 src/distribution/src/main/scripts/conf/log4j.xml   |   59 +
 src/distribution/src/main/scripts/conf/shards      |    1 +
 .../src/main/scripts/interface/Blur.thrift         |  732 +
 .../src/main/scripts/interface/apache.header       |   19 +
 .../src/main/scripts/interface/gen-html/Blur.html  |  526 +
 .../src/main/scripts/interface/gen-html/index.html |   72 +
 .../src/main/scripts/interface/gen-html/style.css  |  184 +
 .../generated/AlternateColumnDefinition.java       |  420 +
 .../blur/thrift/generated/AnalyzerDefinition.java  |  717 +
 .../org/apache/blur/thrift/generated/Blur.java     |25134 +++++++++++++++
 .../blur/thrift/generated/BlurException.java       |  533 +
 .../apache/blur/thrift/generated/BlurQuery.java    | 2019 ++
 .../blur/thrift/generated/BlurQueryStatus.java     | 1044 +
 .../apache/blur/thrift/generated/BlurResult.java   |  647 +
 .../apache/blur/thrift/generated/BlurResults.java  | 1208 +
 .../org/apache/blur/thrift/generated/Column.java   |  532 +
 .../blur/thrift/generated/ColumnDefinition.java    |  674 +
 .../thrift/generated/ColumnFamilyDefinition.java   |  602 +
 .../blur/thrift/generated/ColumnPreCache.java      |  472 +
 .../org/apache/blur/thrift/generated/CpuTime.java  |  524 +
 .../apache/blur/thrift/generated/ExpertQuery.java  |  554 +
 .../org/apache/blur/thrift/generated/Facet.java    |  508 +
 .../blur/thrift/generated/FetchRecordResult.java   |  537 +
 .../apache/blur/thrift/generated/FetchResult.java  |  870 +
 .../blur/thrift/generated/FetchRowResult.java      |  425 +
 .../apache/blur/thrift/generated/QueryState.java   |   73 +
 .../org/apache/blur/thrift/generated/Record.java   |  698 +
 .../blur/thrift/generated/RecordMutation.java      |  545 +
 .../blur/thrift/generated/RecordMutationType.java  |   77 +
 .../org/apache/blur/thrift/generated/Row.java      |  704 +
 .../apache/blur/thrift/generated/RowMutation.java  | 1022 +
 .../blur/thrift/generated/RowMutationType.java     |   73 +
 .../org/apache/blur/thrift/generated/Schema.java   |  631 +
 .../apache/blur/thrift/generated/ScoreType.java    |   77 +
 .../org/apache/blur/thrift/generated/Selector.java | 1235 +
 .../apache/blur/thrift/generated/SimpleQuery.java  |  879 +
 .../blur/thrift/generated/TableDescriptor.java     | 1820 ++
 .../apache/blur/thrift/generated/TableStats.java   |  848 +
 .../main/scripts/interface/gen-perl/Blur/Blur.pm   | 6322 ++++
 .../scripts/interface/gen-perl/Blur/Constants.pm   |   13 +
 .../main/scripts/interface/gen-perl/Blur/Types.pm  | 3316 ++
 .../src/main/scripts/interface/gen-rb/blur.rb      | 1671 +
 .../scripts/interface/gen-rb/blur_constants.rb     |   11 +
 .../main/scripts/interface/gen-rb/blur_types.rb    |  755 +
 .../src/main/scripts/interface/genAndReplace.sh    |   28 +
 src/pom.xml                                        |  154 +-
 180 files changed, 77703 insertions(+), 8834 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-core/pom.xml
----------------------------------------------------------------------
diff --git a/src/blur-core/pom.xml b/src/blur-core/pom.xml
index 0294a79..1dc7d7e 100644
--- a/src/blur-core/pom.xml
+++ b/src/blur-core/pom.xml
@@ -19,12 +19,13 @@ under the License.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>org.apache.blur</groupId>
 		<artifactId>blur</artifactId>
-		<version>0.1.3</version>
+		<version>0.1.5</version>
+        <relativePath>../pom.xml</relativePath>
 	</parent>
-	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.apache.blur</groupId>
 	<artifactId>blur-core</artifactId>
 	<packaging>jar</packaging>
@@ -38,46 +39,57 @@ under the License.
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-thrift</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-store</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.blur</groupId>
+			<artifactId>blur-query</artifactId>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-util</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-gui</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 			<type>jar</type>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-gui</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 			<type>war</type>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.zookeeper</groupId>
 			<artifactId>zookeeper</artifactId>
-			<version>3.3.4</version>
+			<version>${zookeeper.version}</version>
 			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.hadoop</groupId>
 			<artifactId>hadoop-test</artifactId>
-			<version>0.20.2-cdh3u5</version>
+			<version>${hadoop.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.jersey</groupId>
+			<artifactId>jersey-core</artifactId>
+			<version>${jersey.version}</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
 			<groupId>log4j</groupId>
 			<artifactId>log4j</artifactId>
-			<version>1.2.15</version>
+			<version>${log4j.version}</version>
 			<scope>provided</scope>
 			<exclusions>
 				<exclusion>
@@ -105,10 +117,6 @@ under the License.
 			<id>libdir</id>
 			<url>file://${basedir}/../lib</url>
 		</repository>
-		<repository>
-			<id>cloudera</id>
-			<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
-		</repository>
 	</repositories>
 
 	<build>
@@ -132,28 +140,6 @@ under the License.
 					</execution>
 				</executions>
 			</plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-dependency-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-dependencies</id>
-						<phase>package</phase>
-						<goals>
-							<goal>copy-dependencies</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>${project.build.directory}/../../../lib
-							</outputDirectory>
-							<overWriteReleases>false</overWriteReleases>
-							<overWriteSnapshots>false</overWriteSnapshots>
-							<overWriteIfNewer>true</overWriteIfNewer>
-							<excludeTransitive>true</excludeTransitive>
-							<excludeArtifactIds>junit,commons-cli,commons-logging,hadoop-core,slf4j-api,hadoop-test</excludeArtifactIds>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
 		</plugins>
 	</build>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-demo/pom.xml
----------------------------------------------------------------------
diff --git a/src/blur-demo/pom.xml b/src/blur-demo/pom.xml
index 6cb2a40..d59d16d 100644
--- a/src/blur-demo/pom.xml
+++ b/src/blur-demo/pom.xml
@@ -22,7 +22,7 @@ under the License.
 	<parent>
 		<groupId>org.apache.blur</groupId>
 		<artifactId>blur</artifactId>
-		<version>0.1.3</version>
+		<version>0.1.5</version>
 	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.apache.blur</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-gui/pom.xml
----------------------------------------------------------------------
diff --git a/src/blur-gui/pom.xml b/src/blur-gui/pom.xml
index 9529928..08db7f7 100644
--- a/src/blur-gui/pom.xml
+++ b/src/blur-gui/pom.xml
@@ -1,30 +1,23 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>org.apache.blur</groupId>
 		<artifactId>blur</artifactId>
-		<version>0.1.3</version>
+		<version>0.1.5</version>
+		<relativePath>../pom.xml</relativePath>
 	</parent>
-	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.apache.blur</groupId>
 	<artifactId>blur-gui</artifactId>
 	<packaging>war</packaging>
@@ -38,22 +31,27 @@ under the License.
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-thrift</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-store</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-util</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.yammer.metrics</groupId>
+			<artifactId>metrics-servlet</artifactId>
+			<version>${metrics-core.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>log4j</groupId>
 			<artifactId>log4j</artifactId>
-			<version>1.2.15</version>
+			<version>${log4j.version}</version>
 			<scope>provided</scope>
 			<exclusions>
 				<exclusion>
@@ -102,27 +100,6 @@ under the License.
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
-					<artifactId>maven-dependency-plugin</artifactId>
-					<executions>
-						<execution>
-							<id>copy-dependencies</id>
-							<phase>package</phase>
-							<goals>
-								<goal>copy-dependencies</goal>
-							</goals>
-							<configuration>
-								<outputDirectory>${project.build.directory}/../../../lib</outputDirectory>
-								<overWriteReleases>false</overWriteReleases>
-								<overWriteSnapshots>false</overWriteSnapshots>
-								<overWriteIfNewer>true</overWriteIfNewer>
-								<excludeTransitive>true</excludeTransitive>
-								<excludeArtifactIds>junit,commons-cli,commons-logging,hadoop-core,slf4j-api</excludeArtifactIds>
-							</configuration>
-						</execution>
-					</executions>
-				</plugin>
-				<plugin>
-					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-install-plugin</artifactId>
 					<executions>
 						<execution>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/pom.xml b/src/blur-jdbc/pom.xml
index 77ec480..adccd4c 100644
--- a/src/blur-jdbc/pom.xml
+++ b/src/blur-jdbc/pom.xml
@@ -22,7 +22,7 @@ under the License.
 	<parent>
 		<groupId>org.apache.blur</groupId>
 		<artifactId>blur</artifactId>
-		<version>0.1.3</version>
+		<version>0.1.5</version>
 	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.apache.blur</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-mapred/pom.xml
----------------------------------------------------------------------
diff --git a/src/blur-mapred/pom.xml b/src/blur-mapred/pom.xml
index 81546c3..29511b8 100644
--- a/src/blur-mapred/pom.xml
+++ b/src/blur-mapred/pom.xml
@@ -11,12 +11,13 @@
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>org.apache.blur</groupId>
 		<artifactId>blur</artifactId>
-		<version>0.1.3</version>
+		<version>0.1.5</version>
+        <relativePath>../pom.xml</relativePath>
 	</parent>
-	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.apache.blur</groupId>
 	<artifactId>blur-mapred</artifactId>
 	<packaging>jar</packaging>
@@ -26,28 +27,28 @@
 		<dependency>
 			<groupId>org.apache.zookeeper</groupId>
 			<artifactId>zookeeper</artifactId>
-			<version>3.3.4</version>
+			<version>${zookeeper.version}</version>
 			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-core</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-store</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.blur</groupId>
 			<artifactId>blur-util</artifactId>
-			<version>0.1.3</version>
+			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>log4j</groupId>
 			<artifactId>log4j</artifactId>
-			<version>1.2.15</version>
+			<version>${log4j.version}</version>
 			<scope>provided</scope>
 			<exclusions>
 				<exclusion>
@@ -98,45 +99,6 @@
 					</execution>
 				</executions>
 			</plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-dependency-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-dependencies</id>
-						<phase>package</phase>
-						<goals>
-							<goal>copy-dependencies</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>${project.build.directory}/../../../lib</outputDirectory>
-							<overWriteReleases>false</overWriteReleases>
-							<overWriteSnapshots>false</overWriteSnapshots>
-							<overWriteIfNewer>true</overWriteIfNewer>
-							<excludeTransitive>true</excludeTransitive>
-							<excludeArtifactIds>junit,commons-cli,commons-logging,hadoop-core,slf4j-api</excludeArtifactIds>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<artifactId>maven-assembly-plugin</artifactId>
-				<configuration>
-					<descriptorRefs>
-						<descriptorRef>jar-with-dependencies</descriptorRef>
-					</descriptorRefs>
-				</configuration>
-
-				<executions>
-					<execution>
-						<id>make-assembly</id>
-						<phase>package</phase>
-						<goals>
-							<goal>attached</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
 		</plugins>
 	</build>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/pom.xml
----------------------------------------------------------------------
diff --git a/src/blur-query/pom.xml b/src/blur-query/pom.xml
new file mode 100644
index 0000000..ca48a51
--- /dev/null
+++ b/src/blur-query/pom.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.blur</groupId>
+		<artifactId>blur</artifactId>
+		<version>0.1.5</version>
+        <relativePath>../pom.xml</relativePath>
+	</parent>
+	<groupId>org.apache.blur</groupId>
+	<artifactId>blur-query</artifactId>
+	<packaging>jar</packaging>
+	<name>Blur Query</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.blur</groupId>
+			<artifactId>blur-util</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.blur</groupId>
+			<artifactId>blur-store</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.blur</groupId>
+			<artifactId>blur-thrift</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-core</artifactId>
+			<version>${lucene.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-codecs</artifactId>
+			<version>${lucene.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-analyzers-common</artifactId>
+			<version>${lucene.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-queryparser</artifactId>
+			<version>${lucene.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-cli</groupId>
+			<artifactId>commons-cli</artifactId>
+			<version>${commons-cli.version}</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
+			<artifactId>concurrentlinkedhashmap-lru</artifactId>
+			<version>${concurrentlinkedhashmap-lru.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>${log4j.version}</version>
+			<scope>provided</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>javax.mail</groupId>
+					<artifactId>mail</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.jms</groupId>
+					<artifactId>jms</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>com.sun.jdmk</groupId>
+					<artifactId>jmxtools</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>com.sun.jmx</groupId>
+					<artifactId>jmxri</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+	</dependencies>
+
+	<repositories>
+		<repository>
+			<id>libdir</id>
+			<url>file://${basedir}/../lib</url>
+		</repository>
+	</repositories>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.6</source>
+					<target>1.6</target>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java
new file mode 100644
index 0000000..8f2b2cc
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java
@@ -0,0 +1,106 @@
+package org.apache.blur.lucene.search;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+import java.util.Set;
+
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Weight;
+import org.apache.lucene.search.similarities.Similarity;
+
+public abstract class AbstractWrapperQuery extends Query {
+  protected Query _query;
+  protected boolean _rewritten;
+
+  public AbstractWrapperQuery(Query query) {
+    this(query, false);
+  }
+
+  public AbstractWrapperQuery(Query query, boolean rewritten) {
+    this._query = query;
+    this._rewritten = rewritten;
+  }
+
+  public Query getQuery() {
+    return _query;
+  }
+
+  public boolean isRewritten() {
+    return _rewritten;
+  }
+
+  public abstract Query clone();
+
+  public abstract Weight createWeight(IndexSearcher searcher) throws IOException;
+
+  public void extractTerms(Set<Term> terms) {
+    _query.extractTerms(terms);
+  }
+
+  public float getBoost() {
+    return _query.getBoost();
+  }
+
+  public Similarity getSimilarity(IndexSearcher searcher) {
+    return searcher.getSimilarity();
+  }
+
+  public abstract Query rewrite(IndexReader reader) throws IOException;
+
+  public void setBoost(float b) {
+    _query.setBoost(b);
+  }
+
+  
+  
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((_query == null) ? 0 : _query.hashCode());
+    result = prime * result + (_rewritten ? 1231 : 1237);
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (!super.equals(obj))
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    AbstractWrapperQuery other = (AbstractWrapperQuery) obj;
+    if (_query == null) {
+      if (other._query != null)
+        return false;
+    } else if (!_query.equals(other._query))
+      return false;
+    if (_rewritten != other._rewritten)
+      return false;
+    return true;
+  }
+
+  public abstract String toString();
+
+  public abstract String toString(String field);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
new file mode 100644
index 0000000..1841fe9
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
@@ -0,0 +1,200 @@
+package org.apache.blur.lucene.search;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicLongArray;
+
+import org.apache.lucene.index.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.search.Explanation;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Scorer;
+import org.apache.lucene.search.Weight;
+import org.apache.lucene.util.Bits;
+
+public class FacetQuery extends AbstractWrapperQuery {
+
+  private Query[] facets;
+  private AtomicLongArray counts;
+
+  public FacetQuery(Query query, Query[] facets, AtomicLongArray counts) {
+    super(query, false);
+    this.facets = facets;
+    this.counts = counts;
+  }
+
+  public FacetQuery(Query query, Query[] facets, AtomicLongArray counts, boolean rewritten) {
+    super(query, rewritten);
+    this.facets = facets;
+    this.counts = counts;
+  }
+
+  public String toString() {
+    return "facet:{" + _query.toString() + "}";
+  }
+
+  public String toString(String field) {
+    return "facet:{" + _query.toString(field) + "}";
+  }
+
+  @Override
+  public Query clone() {
+    return new FacetQuery((Query) _query.clone(), facets, counts, _rewritten);
+  }
+
+  @Override
+  public Query rewrite(IndexReader reader) throws IOException {
+    if (_rewritten) {
+      return this;
+    }
+    for (int i = 0; i < facets.length; i++) {
+      facets[i] = facets[i].rewrite(reader);
+    }
+    return new FacetQuery(_query.rewrite(reader), facets, counts, true);
+  }
+
+  @Override
+  public Weight createWeight(IndexSearcher searcher) throws IOException {
+    Weight weight = _query.createWeight(searcher);
+    return new FacetWeight(weight, getWeights(searcher), counts);
+  }
+
+  private Weight[] getWeights(IndexSearcher searcher) throws IOException {
+    Weight[] weights = new Weight[facets.length];
+    for (int i = 0; i < weights.length; i++) {
+      weights[i] = facets[i].createWeight(searcher);
+    }
+    return weights;
+  }
+
+  public static class FacetWeight extends Weight {
+
+    private Weight weight;
+    private Weight[] facets;
+    private AtomicLongArray counts;
+
+    public FacetWeight(Weight weight, Weight[] facets, AtomicLongArray counts) {
+      this.weight = weight;
+      this.facets = facets;
+      this.counts = counts;
+    }
+
+    @Override
+    public Explanation explain(AtomicReaderContext reader, int doc) throws IOException {
+      return weight.explain(reader, doc);
+    }
+
+    @Override
+    public Query getQuery() {
+      return weight.getQuery();
+    }
+
+    @Override
+    public void normalize(float norm, float topLevelBoost) {
+      weight.normalize(norm, topLevelBoost);
+    }
+
+    @Override
+    public Scorer scorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Bits acceptDocs) throws IOException {
+      Scorer scorer = weight.scorer(context, true, topScorer, acceptDocs);
+      if (scorer == null) {
+        return null;
+      }
+      return new FacetScorer(scorer, getScorers(context, true, topScorer, acceptDocs), counts);
+    }
+
+    private Scorer[] getScorers(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Bits acceptDocs) throws IOException {
+      Scorer[] scorers = new Scorer[facets.length];
+      for (int i = 0; i < scorers.length; i++) {
+        scorers[i] = facets[i].scorer(context, scoreDocsInOrder, topScorer, acceptDocs);
+      }
+      return scorers;
+    }
+
+    @Override
+    public float getValueForNormalization() throws IOException {
+      return weight.getValueForNormalization();
+    }
+  }
+
+  public static class FacetScorer extends Scorer {
+
+    private Scorer baseScorer;
+    private Scorer[] facets;
+    private AtomicLongArray counts;
+    private int facetLength;
+
+    public FacetScorer(Scorer scorer, Scorer[] facets, AtomicLongArray counts) {
+      super(scorer.getWeight());
+      this.baseScorer = scorer;
+      this.facets = facets;
+      this.counts = counts;
+      this.facetLength = facets.length;
+    }
+
+    private int processFacets(int doc) throws IOException {
+      if (doc == NO_MORE_DOCS) {
+        return doc;
+      }
+      for (int i = 0; i < facetLength; i++) {
+        Scorer facet = facets[i];
+        if (facet == null) {
+          continue;
+        }
+        int docID = facet.docID();
+        if (docID == NO_MORE_DOCS) {
+          continue;
+        }
+        if (docID == doc) {
+          counts.incrementAndGet(i);
+        } else if (docID < doc) {
+          if (facet.advance(doc) == doc) {
+            counts.incrementAndGet(i);
+          }
+        }
+      }
+      return doc;
+    }
+
+    @Override
+    public float score() throws IOException {
+      return baseScorer.score();
+    }
+
+    @Override
+    public int advance(int target) throws IOException {
+      return processFacets(baseScorer.advance(target));
+    }
+
+    @Override
+    public int docID() {
+      return baseScorer.docID();
+    }
+
+    @Override
+    public int nextDoc() throws IOException {
+      return processFacets(baseScorer.nextDoc());
+    }
+
+    @Override
+    public int freq() throws IOException {
+      return baseScorer.freq();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/PrimeDocCache.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/PrimeDocCache.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/PrimeDocCache.java
new file mode 100644
index 0000000..133522f
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/PrimeDocCache.java
@@ -0,0 +1,100 @@
+package org.apache.blur.lucene.search;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.blur.log.Log;
+import org.apache.blur.log.LogFactory;
+import org.apache.lucene.index.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.ReaderClosedListener;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.Collector;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Scorer;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.util.OpenBitSet;
+
+public class PrimeDocCache {
+
+  private static final Log LOG = LogFactory.getLog(PrimeDocCache.class);
+
+  public static final OpenBitSet EMPTY_BIT_SET = new OpenBitSet();
+
+  private static Map<Term,Map<Object, OpenBitSet>> termPrimeDocMap = new ConcurrentHashMap<Term, Map<Object,OpenBitSet>>();
+
+  /**
+   * The way this method is called via warm up methods the likelihood of
+   * creating multiple bitsets during a race condition is very low, that's why
+   * this method is not synced.
+   */
+  public static OpenBitSet getPrimeDocBitSet(Term primeDocTerm, IndexReader reader) throws IOException {
+    Object key = reader.getCoreCacheKey();
+    final Map<Object, OpenBitSet> primeDocMap = getPrimeDocMap(primeDocTerm);
+    OpenBitSet bitSet = primeDocMap.get(key);
+    if (bitSet == null) {
+      reader.addReaderClosedListener(new ReaderClosedListener() {
+        @Override
+        public void onClose(IndexReader reader) {
+          Object key = reader.getCoreCacheKey();
+          LOG.debug("Current size [" + primeDocMap.size() + "] Prime Doc BitSet removing for segment [" + reader + "]");
+          primeDocMap.remove(key);
+        }
+      });
+      LOG.debug("Prime Doc BitSet missing for segment [" + reader + "] current size [" + primeDocMap.size() + "]");
+      final OpenBitSet bs = new OpenBitSet(reader.maxDoc());
+      primeDocMap.put(key, bs);
+      IndexSearcher searcher = new IndexSearcher(reader);
+      searcher.search(new TermQuery(primeDocTerm), new Collector() {
+
+        @Override
+        public void setScorer(Scorer scorer) throws IOException {
+
+        }
+
+        @Override
+        public void setNextReader(AtomicReaderContext atomicReaderContext) throws IOException {
+        }
+
+        @Override
+        public void collect(int doc) throws IOException {
+          bs.set(doc);
+        }
+
+        @Override
+        public boolean acceptsDocsOutOfOrder() {
+          return false;
+        }
+      });
+      return bs;
+    }
+    return bitSet;
+  }
+
+  private static Map<Object, OpenBitSet> getPrimeDocMap(Term primeDocTerm) {
+    Map<Object, OpenBitSet> map = termPrimeDocMap.get(primeDocTerm);
+    if (map == null) {
+      termPrimeDocMap.put(primeDocTerm, new ConcurrentHashMap<Object, OpenBitSet>());
+      return termPrimeDocMap.get(primeDocTerm);
+    }
+    return map;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/ScoreType.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/ScoreType.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/ScoreType.java
new file mode 100644
index 0000000..f32c7f0
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/ScoreType.java
@@ -0,0 +1,22 @@
+package org.apache.blur.lucene.search;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+public enum ScoreType {
+  AGGREGATE, BEST, CONSTANT, SUPER
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/SlowQuery.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/SlowQuery.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/SlowQuery.java
new file mode 100644
index 0000000..d333e30
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/SlowQuery.java
@@ -0,0 +1,137 @@
+package org.apache.blur.lucene.search;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+
+import org.apache.lucene.index.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.search.Explanation;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Scorer;
+import org.apache.lucene.search.Weight;
+import org.apache.lucene.util.Bits;
+
+public class SlowQuery extends Query {
+
+  private Query query;
+  private boolean rewritten = false;
+
+  public SlowQuery(Query query) {
+    this.query = query;
+  }
+
+  @Override
+  public Weight createWeight(IndexSearcher searcher) throws IOException {
+    Weight weight = query.createWeight(searcher);
+    return new SlowWeight(this, weight);
+  }
+
+  @Override
+  public Query rewrite(IndexReader reader) throws IOException {
+    if (!rewritten) {
+      query = query.rewrite(reader);
+    }
+    return this;
+  }
+
+  @Override
+  public String toString(String field) {
+    return query.toString(field);
+  }
+
+  public static class SlowWeight extends Weight {
+
+    private final Weight weight;
+    private final Query query;
+
+    public SlowWeight(Query query, Weight weight) {
+      this.query = query;
+      this.weight = weight;
+    }
+
+    @Override
+    public Explanation explain(AtomicReaderContext context, int doc) throws IOException {
+      return weight.explain(context, doc);
+    }
+
+    @Override
+    public Query getQuery() {
+      return query;
+    }
+
+    @Override
+    public float getValueForNormalization() throws IOException {
+      return weight.getValueForNormalization();
+    }
+
+    @Override
+    public void normalize(float norm, float topLevelBoost) {
+      weight.normalize(norm, topLevelBoost);
+    }
+
+    @Override
+    public Scorer scorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Bits acceptDocs) throws IOException {
+      Scorer scorer = weight.scorer(context, scoreDocsInOrder, topScorer, acceptDocs);
+      if (scorer == null) {
+        highCpuWait(1);
+        return null;
+      }
+      return new SlowScorer(weight, scorer);
+    }
+
+  }
+
+  public static class SlowScorer extends Scorer {
+
+    private final Scorer scorer;
+
+    protected SlowScorer(Weight weight, Scorer scorer) {
+      super(weight);
+      this.scorer = scorer;
+    }
+
+    public int docID() {
+      return scorer.docID();
+    }
+
+    public int nextDoc() throws IOException {
+      highCpuWait(1);
+      return scorer.nextDoc();
+    }
+
+    public int advance(int target) throws IOException {
+      highCpuWait(1);
+      return scorer.advance(target);
+    }
+
+    public float score() throws IOException {
+      return scorer.score();
+    }
+
+    public int freq() throws IOException {
+      return scorer.freq();
+    }
+
+  }
+
+  public static void highCpuWait(long ms) {
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java
new file mode 100644
index 0000000..d97a14f
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java
@@ -0,0 +1,67 @@
+package org.apache.blur.lucene.search;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.lucene.index.AtomicReaderContext;
+import org.apache.lucene.search.Collector;
+import org.apache.lucene.search.Scorer;
+
+public class StopExecutionCollector extends Collector {
+
+  private static final long _5MS = TimeUnit.MILLISECONDS.toNanos(5);
+
+  private Collector _collector;
+  private AtomicBoolean _running;
+  private long last;
+
+  public StopExecutionCollector(Collector collector, AtomicBoolean running) {
+    _collector = collector;
+    _running = running;
+  }
+
+  public static class StopExecutionCollectorException extends RuntimeException {
+    private static final long serialVersionUID = 5753875017543945163L;
+  }
+
+  public boolean acceptsDocsOutOfOrder() {
+    return _collector.acceptsDocsOutOfOrder();
+  }
+
+  public void collect(int doc) throws IOException {
+    long now = System.nanoTime();
+    if (last + _5MS < now) {
+      if (!_running.get()) {
+        throw new StopExecutionCollectorException();
+      }
+      last = now;
+    }
+    _collector.collect(doc);
+  }
+
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    _collector.setNextReader(context);
+  }
+
+  public void setScorer(Scorer scorer) throws IOException {
+    _collector.setScorer(scorer);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperParser.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperParser.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperParser.java
new file mode 100644
index 0000000..80a53fa
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperParser.java
@@ -0,0 +1,79 @@
+package org.apache.blur.lucene.search;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.queryparser.classic.ParseException;
+import org.apache.lucene.queryparser.classic.QueryParser;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.util.Version;
+
+public class SuperParser extends QueryParser {
+
+  private static final String MUST_NOT_STRING = "-";
+  private static final String MUST_STRING = "+";
+  private static final Pattern PATTERN = Pattern.compile("([-+]{0,1})\\s*?super\\s*?\\:\\s*?\\<(.*?)\\>");
+  private static final Pattern CHECK = Pattern.compile("super\\s*?\\:\\s*?\\<");
+
+  private final Analyzer a;
+  private final String f;
+  private final Version matchVersion;
+  private final Term defaultPrimeDocTerm;
+  private final ScoreType defaultScoreType;
+
+  public SuperParser(Version matchVersion, String f, Analyzer a, ScoreType defaultScoreType, Term defaultPrimeDocTerm) {
+    super(matchVersion, f, a);
+    this.matchVersion = matchVersion;
+    this.f = f;
+    this.a = a;
+    this.defaultPrimeDocTerm = defaultPrimeDocTerm;
+    this.defaultScoreType = defaultScoreType;
+  }
+
+  @Override
+  public Query parse(String query) throws ParseException {
+    Matcher matcher = PATTERN.matcher(query);
+    BooleanQuery booleanQuery = null;
+    while (matcher.find()) {
+      int count = matcher.groupCount();
+      for (int i = 0; i < count; i++) {
+        String occurString = matcher.group(i + 1);
+        i++;
+        String superQueryStr = matcher.group(i + 1);
+        Matcher matcherCheck = CHECK.matcher(superQueryStr);
+        if (matcherCheck.find()) {
+          throw new ParseException("Embedded super queries are not allowed [" + query + "].");
+        }
+
+        if (booleanQuery == null) {
+          booleanQuery = new BooleanQuery();
+        }
+
+        Occur occur = getOccur(occurString);
+        QueryParser parser = new QueryParser(matchVersion, f, a);
+
+        Query superQuery = parser.parse(superQueryStr);
+        booleanQuery.add(new SuperQuery(superQuery, defaultScoreType, defaultPrimeDocTerm), occur);
+      }
+    }
+    if (booleanQuery == null) {
+      return super.parse(query);
+    }
+    return booleanQuery;
+  }
+
+  private Occur getOccur(String occurString) {
+    if (occurString.equals(MUST_STRING)) {
+      return Occur.MUST;
+    }
+    if (occurString.equals(MUST_NOT_STRING)) {
+      return Occur.MUST_NOT;
+    }
+    return Occur.SHOULD;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java b/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
new file mode 100644
index 0000000..72be513
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
@@ -0,0 +1,316 @@
+package org.apache.blur.lucene.search;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+
+import org.apache.lucene.index.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.Explanation;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Scorer;
+import org.apache.lucene.search.Weight;
+import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.OpenBitSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SuperQuery extends AbstractWrapperQuery {
+
+  private final ScoreType scoreType;
+  private final Term primeDocTerm;
+
+  public SuperQuery(Query query, ScoreType scoreType, Term primeDocTerm) {
+    super(query, false);
+    this.scoreType = scoreType;
+    this.primeDocTerm = primeDocTerm;
+  }
+
+  public SuperQuery(Query query, ScoreType scoreType, Term primeDocTerm, boolean rewritten) {
+    super(query, rewritten);
+    this.scoreType = scoreType;
+    this.primeDocTerm = primeDocTerm;
+  }
+  
+
+  public ScoreType getScoreType() {
+    return scoreType;
+  }
+
+  public Term getPrimeDocTerm() {
+    return primeDocTerm;
+  }
+
+  public Query clone() {
+    return new SuperQuery((Query) _query.clone(), scoreType, primeDocTerm, _rewritten);
+  }
+
+  public Weight createWeight(IndexSearcher searcher) throws IOException {
+    Weight weight = _query.createWeight(searcher);
+    return new SuperWeight(weight, _query.toString(), this, scoreType, primeDocTerm);
+  }
+
+  public Query rewrite(IndexReader reader) throws IOException {
+    if (_rewritten) {
+      return this;
+    }
+    return new SuperQuery(_query.rewrite(reader), scoreType, primeDocTerm, true);
+  }
+
+  public String toString() {
+    return "super:<" + _query.toString() + ">";
+  }
+
+  public String toString(String field) {
+    return "super:<" + _query.toString(field) + ">";
+  }
+  
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((primeDocTerm == null) ? 0 : primeDocTerm.hashCode());
+    result = prime * result + ((scoreType == null) ? 0 : scoreType.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (!super.equals(obj))
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    SuperQuery other = (SuperQuery) obj;
+    if (primeDocTerm == null) {
+      if (other.primeDocTerm != null)
+        return false;
+    } else if (!primeDocTerm.equals(other.primeDocTerm))
+      return false;
+    if (scoreType != other.scoreType)
+      return false;
+    return true;
+  }
+
+  public static class SuperWeight extends Weight {
+
+    private final Weight weight;
+    private final String originalQueryStr;
+    private final Query query;
+    private final ScoreType scoreType;
+    private final Term primeDocTerm;
+
+    public SuperWeight(Weight weight, String originalQueryStr, Query query, ScoreType scoreType, Term primeDocTerm) {
+      this.weight = weight;
+      this.originalQueryStr = originalQueryStr;
+      this.query = query;
+      this.scoreType = scoreType;
+      this.primeDocTerm = primeDocTerm;
+    }
+
+    @Override
+    public Query getQuery() {
+      return query;
+    }
+
+    @Override
+    public Explanation explain(AtomicReaderContext context, int doc) throws IOException {
+      throw new RuntimeException("not supported");
+    }
+
+    /*
+     * This method needs to implement in some other way Weight doesn't provide
+     * this method at all
+     * 
+     * @Override public float getValue() { return weight.getValue(); }
+     */
+
+    @Override
+    public void normalize(float norm, float topLevelBoost) {
+      weight.normalize(norm, topLevelBoost);
+    }
+
+    @Override
+    public Scorer scorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Bits acceptDocs) throws IOException {
+      Scorer scorer = weight.scorer(context, true, topScorer, acceptDocs);
+      if (scorer == null) {
+        return null;
+      }
+      OpenBitSet primeDocBitSet = PrimeDocCache.getPrimeDocBitSet(primeDocTerm, context.reader());
+      return new SuperScorer(scorer, primeDocBitSet, originalQueryStr, scoreType);
+    }
+
+    @Override
+    public float getValueForNormalization() throws IOException {
+      return weight.getValueForNormalization();
+    }
+
+  }
+
+  @SuppressWarnings("unused")
+  public static class SuperScorer extends Scorer {
+
+    private static final Logger LOG = LoggerFactory.getLogger(SuperScorer.class);
+
+    private static final String DOC_ID = "docId";
+    private static final String NEXT_DOC = "nextDoc";
+    private static final String ADVANCE = "advance";
+    private static final double SUPER_POWER_CONSTANT = 2;
+    private static final boolean debug = false;
+    private final Scorer scorer;
+    private final OpenBitSet bitSet;
+    private final String originalQueryStr;
+    private final ScoreType scoreType;
+    private int nextPrimeDoc;
+    private int primeDoc = -1;
+    private int numDocs;
+    private float bestScore;
+    private float aggregateScore;
+    private int hitsInEntity;
+
+    protected SuperScorer(Scorer scorer, OpenBitSet bitSet, String originalQueryStr, ScoreType scoreType) {
+      super(scorer.getWeight());
+      this.scorer = scorer;
+      this.bitSet = bitSet;
+      this.originalQueryStr = originalQueryStr;
+      this.scoreType = scoreType;
+    }
+
+    @Override
+    public float score() throws IOException {
+      switch (scoreType) {
+      case AGGREGATE:
+        return aggregateScore;
+      case BEST:
+        return bestScore;
+      case CONSTANT:
+        return 1;
+      case SUPER:
+        double log = Math.log10(aggregateScore) + 1.0;
+        double avg = aggregateScore / hitsInEntity;
+        double pow = Math.pow(avg, SUPER_POWER_CONSTANT);
+        return (float) Math.pow(log + pow, 1.0 / SUPER_POWER_CONSTANT);
+      }
+      throw new RuntimeException("Unknown Score type[" + scoreType + "]");
+    }
+
+    @Override
+    public int docID() {
+      return print(DOC_ID, primeDoc);
+    }
+
+    @Override
+    public int advance(int target) throws IOException {
+      if (target == NO_MORE_DOCS) {
+        return print(ADVANCE, primeDoc = scorer.advance(NO_MORE_DOCS));
+      }
+      int doc = scorer.docID();
+      int odoc = doc;
+      if (isScorerExhausted(doc)) {
+        return print(ADVANCE, primeDoc = doc);
+      }
+      if (target > doc || doc == -1) {
+        doc = scorer.advance(target);
+        if (isScorerExhausted(doc)) {
+          return print(ADVANCE, primeDoc = doc);
+        }
+      } else if (isScorerExhausted(doc)) {
+        return print(ADVANCE, primeDoc == -1 ? primeDoc = doc : primeDoc);
+      }
+      return print(ADVANCE, gatherAllHitsSuperDoc(doc));
+    }
+
+    private int print(String message, int i) {
+      if (debug) {
+        System.out.println(message + " [" + i + "] " + originalQueryStr);
+      }
+      return i;
+    }
+
+    @Override
+    public int nextDoc() throws IOException {
+      int doc = scorer.docID();
+      int odoc = doc;
+      if (isScorerExhausted(doc)) {
+        return primeDoc = doc;
+      }
+      if (doc == -1) {
+        doc = scorer.nextDoc();
+        if (isScorerExhausted(doc)) {
+          return print(NEXT_DOC, primeDoc = doc);
+        }
+      } else if (isScorerExhausted(doc)) {
+        return print(NEXT_DOC, primeDoc == -1 ? primeDoc = doc : primeDoc);
+      }
+
+      return print(NEXT_DOC, gatherAllHitsSuperDoc(doc));
+    }
+
+    private int gatherAllHitsSuperDoc(int doc) throws IOException {
+      reset();
+      primeDoc = getPrimeDoc(doc);
+      nextPrimeDoc = getNextPrimeDoc(doc);
+      numDocs = nextPrimeDoc - primeDoc;
+      float currentDocScore = 0;
+      while (doc < nextPrimeDoc) {
+        currentDocScore = scorer.score();
+        aggregateScore += currentDocScore;
+        if (currentDocScore > bestScore) {
+          bestScore = currentDocScore;
+        }
+        hitsInEntity++;
+        doc = scorer.nextDoc();
+      }
+      return primeDoc;
+    }
+
+    private void reset() {
+      numDocs = 0;
+      bestScore = 0;
+      aggregateScore = 0;
+      hitsInEntity = 0;
+    }
+
+    private int getNextPrimeDoc(int doc) {
+      int nextSetBit = bitSet.nextSetBit(doc + 1);
+      return nextSetBit == -1 ? NO_MORE_DOCS : nextSetBit;
+    }
+
+    private int getPrimeDoc(int doc) {
+      if (bitSet.fastGet(doc)) {
+        return doc;
+      }
+      return bitSet.prevSetBit(doc);
+    }
+
+    private boolean isScorerExhausted(int doc) {
+      return doc == NO_MORE_DOCS ? true : false;
+    }
+
+    @Override
+    public int freq() throws IOException {
+      return scorer.freq();
+    }
+  }
+
+  public Query getQuery() {
+    return _query;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java
new file mode 100644
index 0000000..68a62c2
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java
@@ -0,0 +1,40 @@
+package org.apache.blur.lucene.serializer;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import org.apache.hadoop.io.Writable;
+import org.apache.lucene.search.Query;
+
+public abstract class AbtractQueryWritable<T extends Query> implements Writable, Cloneable {
+
+  public abstract T getQuery();
+
+  public abstract void setQuery(T query);
+
+  public abstract Class<T> getType();
+
+  @SuppressWarnings("unchecked")
+  @Override
+  public AbtractQueryWritable<T> clone() {
+    try {
+      return (AbtractQueryWritable<T>) super.clone();
+    } catch (CloneNotSupportedException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java
new file mode 100644
index 0000000..e96a19b
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java
@@ -0,0 +1,87 @@
+package org.apache.blur.lucene.serializer;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanClause.Occur;
+
+public class BooleanClauseWritable implements Writable {
+
+  private BooleanClause booleanClause;
+
+  public BooleanClauseWritable() {
+
+  }
+
+  public BooleanClauseWritable(BooleanClause booleanClause) {
+    this.booleanClause = booleanClause;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    Occur occur = booleanClause.getOccur();
+    switch (occur) {
+    case MUST:
+      out.write(0);
+      break;
+    case MUST_NOT:
+      out.write(1);
+      break;
+    case SHOULD:
+      out.write(2);
+      break;
+    default:
+      throw new RuntimeException("Occur [" + occur + "] not supported");
+    }
+    new QueryWritable(booleanClause.getQuery()).write(out);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    Occur occur = null;
+    byte o = in.readByte();
+    switch (o) {
+    case 0:
+      occur = Occur.MUST;
+      break;
+    case 1:
+      occur = Occur.MUST_NOT;
+      break;
+    case 2:
+      occur = Occur.SHOULD;
+      break;
+    default:
+      throw new RuntimeException("Occur [" + o + "] not supported");
+    }
+    QueryWritable queryWritable = new QueryWritable();
+    queryWritable.readFields(in);
+    booleanClause = new BooleanClause(queryWritable.getQuery(), occur);
+  }
+
+  public BooleanClause getBooleanClause() {
+    return booleanClause;
+  }
+
+  public void setBooleanClause(BooleanClause booleanClause) {
+    this.booleanClause = booleanClause;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java
new file mode 100644
index 0000000..a21afce
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java
@@ -0,0 +1,78 @@
+package org.apache.blur.lucene.serializer;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+
+public class BooleanQueryWritable extends AbtractQueryWritable<BooleanQuery> {
+
+  private BooleanQuery query;
+
+  public BooleanQuery getQuery() {
+    return query;
+  }
+
+  public void setQuery(BooleanQuery query) {
+    this.query = query;
+  }
+
+  public BooleanQueryWritable() {
+
+  }
+
+  public BooleanQueryWritable(BooleanQuery booleanQuery) {
+    this.query = booleanQuery;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeBoolean(query.isCoordDisabled());
+    out.writeFloat(query.getBoost());
+    out.writeInt(query.getMinimumNumberShouldMatch());
+    BooleanClause[] clauses = query.getClauses();
+    out.writeInt(clauses.length);
+    for (int i = 0; i < clauses.length; i++) {
+      BooleanClauseWritable booleanClauseWritable = new BooleanClauseWritable(clauses[i]);
+      booleanClauseWritable.write(out);
+    }
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    query = new BooleanQuery(in.readBoolean());
+    query.setBoost(in.readFloat());
+    query.setMinimumNumberShouldMatch(in.readInt());
+    int length = in.readInt();
+    for (int i = 0; i < length; i++) {
+      BooleanClauseWritable booleanClauseWritable = new BooleanClauseWritable();
+      booleanClauseWritable.readFields(in);
+      query.add(booleanClauseWritable.getBooleanClause());
+    }
+
+  }
+
+  @Override
+  public Class<BooleanQuery> getType() {
+    return BooleanQuery.class;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java
new file mode 100644
index 0000000..fe1d920
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java
@@ -0,0 +1,110 @@
+package org.apache.blur.lucene.serializer;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.FuzzyQuery;
+
+public class FuzzyQueryWritable extends AbtractQueryWritable<FuzzyQuery> {
+
+  private FuzzyQuery query;
+  private static Field maxExpansionsField;
+  private static Field transpositionsField;
+
+  static {
+    try {
+      maxExpansionsField = FuzzyQuery.class.getDeclaredField("maxExpansions");
+      transpositionsField = FuzzyQuery.class.getDeclaredField("transpositions");
+      maxExpansionsField.setAccessible(true);
+      transpositionsField.setAccessible(true);
+    } catch (SecurityException e) {
+      throw new RuntimeException(e);
+    } catch (NoSuchFieldException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  public FuzzyQueryWritable() {
+
+  }
+
+  public FuzzyQueryWritable(FuzzyQuery query) {
+    this.query = query;
+  }
+
+  public FuzzyQuery getQuery() {
+    return query;
+  }
+
+  public void setQuery(FuzzyQuery query) {
+    this.query = query;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeFloat(query.getBoost());
+    new TermWritable(query.getTerm()).write(out);
+    out.writeInt(query.getMaxEdits());
+    out.writeInt(query.getPrefixLength());
+    out.writeInt(getMaxExpansions(query));
+    out.writeBoolean(getTranspositions(query));
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    float boost = in.readFloat();
+    TermWritable termWritable = new TermWritable();
+    termWritable.readFields(in);
+    Term term = termWritable.getTerm();
+    int maxEdits = in.readInt();
+    int prefixLength = in.readInt();
+    int maxExpansions = in.readInt();
+    boolean transpositions = in.readBoolean();
+    query = new FuzzyQuery(term, maxEdits, prefixLength, maxExpansions, transpositions);
+    query.setBoost(boost);
+  }
+
+  private static boolean getTranspositions(FuzzyQuery query) {
+    try {
+      return transpositionsField.getBoolean(query);
+    } catch (IllegalArgumentException e) {
+      throw new RuntimeException(e);
+    } catch (IllegalAccessException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  private static int getMaxExpansions(FuzzyQuery query) {
+    try {
+      return maxExpansionsField.getInt(query);
+    } catch (IllegalArgumentException e) {
+      throw new RuntimeException(e);
+    } catch (IllegalAccessException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  @Override
+  public Class<FuzzyQuery> getType() {
+    return FuzzyQuery.class;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/IOUtil.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/IOUtil.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/IOUtil.java
new file mode 100644
index 0000000..64a611c
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/IOUtil.java
@@ -0,0 +1,30 @@
+package org.apache.blur.lucene.serializer;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class IOUtil {
+
+  private static final String UTF_8 = "UTF-8";
+
+  public static void writeString(DataOutput out, String s) throws IOException {
+    if (s == null) {
+      out.writeInt(-1);
+    }
+    byte[] bytes = s.getBytes(UTF_8);
+    out.writeInt(bytes.length);
+    out.write(bytes);
+  }
+
+  public static String readString(DataInput in) throws IOException {
+    int length = in.readInt();
+    if (length == -1) {
+      return null;
+    }
+    byte[] bs = new byte[length];
+    in.readFully(bs);
+    return new String(bs, UTF_8);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/MatchAllDocsQueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/MatchAllDocsQueryWritable.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/MatchAllDocsQueryWritable.java
new file mode 100644
index 0000000..8828b00
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/MatchAllDocsQueryWritable.java
@@ -0,0 +1,40 @@
+package org.apache.blur.lucene.serializer;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.lucene.search.MatchAllDocsQuery;
+
+public class MatchAllDocsQueryWritable extends AbtractQueryWritable<MatchAllDocsQuery> {
+
+  private MatchAllDocsQuery query;
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeFloat(query.getBoost());
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    float boost = in.readFloat();
+    query = new MatchAllDocsQuery();
+    query.setBoost(boost);
+  }
+
+  @Override
+  public MatchAllDocsQuery getQuery() {
+    return query;
+  }
+
+  @Override
+  public void setQuery(MatchAllDocsQuery query) {
+    this.query = query;
+  }
+
+  @Override
+  public Class<MatchAllDocsQuery> getType() {
+    return MatchAllDocsQuery.class;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java
new file mode 100644
index 0000000..b90d8b2
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java
@@ -0,0 +1,88 @@
+package org.apache.blur.lucene.serializer;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+
+import org.apache.blur.lucene.search.ScoreType;
+import org.apache.blur.lucene.search.SuperQuery;
+import org.apache.hadoop.io.DataInputBuffer;
+import org.apache.hadoop.io.DataOutputBuffer;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.queryparser.classic.ParseException;
+import org.apache.lucene.queryparser.classic.QueryParser;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.util.Version;
+
+public class ProtoSerializer {
+
+  public static void main(String[] args) throws ParseException, IOException {
+
+    QueryParser parser = new QueryParser(Version.LUCENE_40, "", new StandardAnalyzer(Version.LUCENE_40));
+
+    Query query = parser.parse("a:v1 b:v2 c:v3~ c:asda*asda");
+    
+    SuperQuery superQuery = new SuperQuery(query,ScoreType.SUPER,new Term("_primedoc_"));
+
+    QueryWritable queryWritable = new QueryWritable(superQuery);
+    DataOutputBuffer buffer = new DataOutputBuffer();
+    queryWritable.write(buffer);
+    buffer.close();
+
+    System.out.println(new String(buffer.getData(), 0, buffer.getLength()));
+
+    QueryWritable qw = new QueryWritable();
+
+    DataInputBuffer in = new DataInputBuffer();
+    in.reset(buffer.getData(), 0, buffer.getLength());
+    qw.readFields(in);
+
+    System.out.println("------------");
+    
+    System.out.println(qw.getQuery());
+    
+    System.out.println("------------");
+
+    while (true) {
+      run(superQuery);
+    }
+  }
+
+  private static void run(Query query) throws IOException {
+
+    DataOutputBuffer buffer = new DataOutputBuffer();
+    DataInputBuffer in = new DataInputBuffer();
+    QueryWritable outQw = new QueryWritable();
+    QueryWritable inQw = new QueryWritable();
+
+    long s = System.nanoTime();
+    int count = 100000;
+    for (int i = 0; i < count; i++) {
+      outQw.setQuery(query);
+      outQw.write(buffer);
+
+      in.reset(buffer.getData(), 0, buffer.getLength());
+      inQw.readFields(in);
+
+      buffer.reset();
+    }
+    long e = System.nanoTime();
+    System.out.println((e - s) / 1000000.0 / (double) count);
+    // System.out.println((e - s) / (double) count);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a4601422/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/QueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/QueryWritable.java b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/QueryWritable.java
new file mode 100644
index 0000000..9e9c227
--- /dev/null
+++ b/src/blur-query/src/main/java/org/apache/blur/lucene/serializer/QueryWritable.java
@@ -0,0 +1,74 @@
+package org.apache.blur.lucene.serializer;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.lucene.search.Query;
+
+public class QueryWritable extends AbtractQueryWritable<Query> {
+
+  private Query query;
+  private QueryWritableMapper lookup;
+
+  public QueryWritable() {
+
+  }
+
+  public QueryWritable(Query query) {
+    this.query = query;
+    this.lookup = QueryWritableMapper.lookup(query);
+  }
+
+  public Query getQuery() {
+    return query;
+  }
+
+  public void setQuery(Query query) {
+    this.query = query;
+    this.lookup = QueryWritableMapper.lookup(query);
+  }
+
+  public QueryWritableMapper getLookup() {
+    return lookup;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeInt(lookup.getType());
+    AbtractQueryWritable<Query> writable = QueryWritableMapper.getNewQueryWritable(lookup, Query.class);
+    writable.setQuery(query);
+    writable.write(out);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    int t = in.readInt();
+    lookup = QueryWritableMapper.lookup(t);
+    AbtractQueryWritable<Query> writable = QueryWritableMapper.getNewQueryWritable(lookup, Query.class);
+    writable.readFields(in);
+    query = writable.getQuery();
+  }
+
+  @Override
+  public Class<Query> getType() {
+    return Query.class;
+  }
+
+}


Mime
View raw message