incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [4/6] git commit: BLUR-ID-64-changed-parser
Date Thu, 11 Apr 2013 03:10:52 GMT
BLUR-ID-64-changed-parser

Signed-off-by: Aaron McCurry <amccurry@gmail.com>


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

Branch: refs/heads/0.1.5
Commit: c1231e3447da27dfe2144decc9290a9757b33975
Parents: 349e8aa
Author: Gagan <gagandeepjuneja@gmail.com>
Authored: Wed Apr 10 23:16:15 2013 +0530
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Apr 10 21:52:07 2013 -0400

----------------------------------------------------------------------
 .../org/apache/blur/analysis/BlurAnalyzer.java     |  437 ---------------
 .../org/apache/blur/analysis/DoubleAnalyzer.java   |   83 ---
 .../org/apache/blur/analysis/FloatAnalyzer.java    |   86 ---
 .../org/apache/blur/analysis/IntegerAnalyzer.java  |  101 ----
 .../org/apache/blur/analysis/LongAnalyzer.java     |  101 ----
 .../blur/lucene/search/AbstractWrapperQuery.java   |   76 ---
 .../org/apache/blur/lucene/search/FacetQuery.java  |  200 -------
 .../apache/blur/lucene/search/FairSimilarity.java  |   61 --
 .../apache/blur/lucene/search/IterablePaging.java  |  227 --------
 .../apache/blur/lucene/search/PagingCollector.java |  116 ----
 .../blur/lucene/search/StopExecutionCollector.java |   67 ---
 .../org/apache/blur/lucene/search/SuperParser.java |  245 --------
 .../org/apache/blur/lucene/search/SuperQuery.java  |  276 ---------
 .../java/org/apache/blur/manager/IndexManager.java |   26 +-
 .../org/apache/blur/manager/QueryParserUtil.java   |   11 +-
 .../java/org/apache/blur/server/TableContext.java  |    5 +-
 .../java/org/apache/blur/thrift/TableAdmin.java    |    5 +
 .../org/apache/blur/analysis/BlurAnalyzerTest.java |  133 -----
 .../apache/blur/analysis/DoubleAnalyzerTest.java   |   95 ----
 .../apache/blur/analysis/FloatAnalyzerTest.java    |   95 ----
 .../apache/blur/analysis/IntegerAnalyzerTest.java  |  106 ----
 .../org/apache/blur/analysis/LongAnalyzerTest.java |  107 ----
 .../apache/blur/lucene/search/FacetQueryTest.java  |  105 ----
 .../apache/blur/lucene/search/SuperParserTest.java |  236 --------
 .../apache/blur/search/RandomSuperQueryTest.java   |  157 ------
 .../org/apache/blur/search/SuperQueryTest.java     |  204 -------
 .../apache/blur/search/TestingPagingCollector.java |   84 ---
 .../org/apache/blur/analysis/BlurAnalyzer.java     |  437 +++++++++++++++
 .../org/apache/blur/analysis/DoubleAnalyzer.java   |   83 +++
 .../org/apache/blur/analysis/FloatAnalyzer.java    |   86 +++
 .../org/apache/blur/analysis/IntegerAnalyzer.java  |  101 ++++
 .../org/apache/blur/analysis/LongAnalyzer.java     |  101 ++++
 .../apache/blur/lucene/search/FairSimilarity.java  |   61 ++
 .../apache/blur/lucene/search/IterablePaging.java  |  227 ++++++++
 .../apache/blur/lucene/search/PagingCollector.java |  116 ++++
 .../org/apache/blur/lucene/search/ScoreType.java   |   22 -
 .../org/apache/blur/lucene/search/SuperParser.java |  251 ++++++++-
 .../org/apache/blur/lucene/search/SuperQuery.java  |    1 +
 .../blur/lucene/serializer/ProtoSerializer.java    |    2 +-
 .../blur/lucene/serializer/SuperQueryWritable.java |    2 +-
 .../java/org/apache/blur/util/BlurConstants.java   |   28 +
 .../org/apache/blur/analysis/BlurAnalyzerTest.java |  133 +++++
 .../apache/blur/analysis/DoubleAnalyzerTest.java   |   95 ++++
 .../apache/blur/analysis/FloatAnalyzerTest.java    |   95 ++++
 .../apache/blur/analysis/IntegerAnalyzerTest.java  |  106 ++++
 .../org/apache/blur/analysis/LongAnalyzerTest.java |  107 ++++
 .../blur/lucene/search/RandomSuperQueryTest.java   |  152 +++++
 .../apache/blur/lucene/search/SuperParserTest.java |  213 +++++++-
 .../apache/blur/lucene/search/SuperQueryTest.java  |  199 +++++++
 .../blur/lucene/search/TestingPagingCollector.java |   84 +++
 .../apache/blur/search/RandomSuperQueryTest.java   |    2 +-
 .../org/apache/blur/search/SuperQueryTest.java     |    2 +-
 .../apache/blur/search/TestingPagingCollector.java |   84 +++
 53 files changed, 2779 insertions(+), 3456 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java b/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java
deleted file mode 100644
index 5f8f256..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java
+++ /dev/null
@@ -1,437 +0,0 @@
-package org.apache.blur.analysis;
-
-/**
- * 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 static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
-import static org.apache.blur.utils.BlurConstants.PRIME_DOC;
-import static org.apache.blur.utils.BlurConstants.RECORD_ID;
-import static org.apache.blur.utils.BlurConstants.ROW_ID;
-import static org.apache.blur.utils.BlurConstants.SUPER;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.blur.thrift.generated.AlternateColumnDefinition;
-import org.apache.blur.thrift.generated.AnalyzerDefinition;
-import org.apache.blur.thrift.generated.ColumnDefinition;
-import org.apache.blur.thrift.generated.ColumnFamilyDefinition;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataInputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.AnalyzerWrapper;
-import org.apache.lucene.analysis.core.KeywordAnalyzer;
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.document.Field.Index;
-import org.apache.lucene.document.Field.Store;
-import org.apache.lucene.search.NumericRangeQuery;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.util.Version;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TJSONProtocol;
-import org.apache.thrift.transport.TMemoryBuffer;
-import org.apache.thrift.transport.TMemoryInputTransport;
-
-public final class BlurAnalyzer extends AnalyzerWrapper {
-
-  public enum TYPE {
-    LONG, DOUBLE, FLOAT, INTEGER, DEFAULT
-  }
-
-  @SuppressWarnings("serial")
-  private static Set<String> typeNameCache = new HashSet<String>() {
-    {
-      TYPE[] values = TYPE.values();
-      for (TYPE t : values) {
-        add(t.name());
-      }
-    }
-  };
-
-  private static final String STANDARD = "org.apache.lucene.analysis.standard.StandardAnalyzer";
-  public static final BlurAnalyzer BLANK_ANALYZER = new BlurAnalyzer(new KeywordAnalyzer());
-  private static Map<String, Class<? extends Analyzer>> aliases = new HashMap<String, Class<? extends Analyzer>>();
-
-  private Map<String, Store> _storeMap = new HashMap<String, Store>();
-  private Map<String, Set<String>> _subIndexNameLookups = new HashMap<String, Set<String>>();
-  private Map<String, Boolean> _fullTextFields = new HashMap<String, Boolean>();
-  private Map<String, Boolean> _fullTextColumnFamilies = new HashMap<String, Boolean>();
-  private AnalyzerDefinition _analyzerDefinition;
-  private Analyzer _fullTextAnalyzer = new StandardAnalyzer(LUCENE_VERSION);
-  private Analyzer _defaultAnalyzer;
-  private Map<String, Analyzer> _analyzers = new HashMap<String, Analyzer>();
-  private Map<String, TYPE> _typeLookup = new HashMap<String, BlurAnalyzer.TYPE>();
-
-  public Set<String> getSubIndexNames(String indexName) {
-    return _subIndexNameLookups.get(indexName);
-  }
-
-  public BlurAnalyzer(Analyzer analyzer) {
-    _analyzerDefinition = new AnalyzerDefinition();
-    _defaultAnalyzer = analyzer;
-  }
-
-  public BlurAnalyzer(AnalyzerDefinition analyzerDefinition) {
-    _analyzerDefinition = analyzerDefinition;
-    ColumnDefinition defaultDefinition = analyzerDefinition.getDefaultDefinition();
-    String fullTextAnalyzerClassName = analyzerDefinition.fullTextAnalyzerClassName;
-    if (fullTextAnalyzerClassName != null) {
-      _fullTextAnalyzer = getAnalyzerByClassName(fullTextAnalyzerClassName, aliases, null, null);
-    }
-    if (defaultDefinition == null) {
-      defaultDefinition = new ColumnDefinition(STANDARD, true, null);
-      analyzerDefinition.setDefaultDefinition(defaultDefinition);
-    }
-    _defaultAnalyzer = getAnalyzerByClassName(defaultDefinition.getAnalyzerClassName(), aliases, null, null);
-    KeywordAnalyzer keywordAnalyzer = new KeywordAnalyzer();
-    _analyzers = new HashMap<String, Analyzer>();
-    _analyzers.put(ROW_ID, keywordAnalyzer);
-    _analyzers.put(RECORD_ID, keywordAnalyzer);
-    _analyzers.put(PRIME_DOC, keywordAnalyzer);
-    _analyzers.put(SUPER, _fullTextAnalyzer);
-    load(_analyzers, _analyzerDefinition.columnFamilyDefinitions, _fullTextFields, _subIndexNameLookups, _storeMap, _fullTextColumnFamilies, _typeLookup);
-  }
-
-  public BlurAnalyzer() {
-    this(new StandardAnalyzer(LUCENE_VERSION));
-  }
-
-  private Analyzer getAnalyzer(String name) {
-    Analyzer analyzer = _analyzers.get(name);
-    return analyzer;
-  }
-
-  public TYPE getTypeLookup(String field) {
-    TYPE type = _typeLookup.get(field);
-    if (type == null) {
-      return TYPE.DEFAULT;
-    }
-    return type;
-  }
-
-  public Query getNewRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) {
-    Analyzer analyzer = getAnalyzer(field);
-    if (analyzer instanceof LongAnalyzer) {
-      LongAnalyzer a = (LongAnalyzer) analyzer;
-      int precisionStep = a.getPrecisionStep();
-      int radix = a.getRadix();
-      long min = Long.parseLong(part1, radix);
-      long max = Long.parseLong(part2, radix);
-      return NumericRangeQuery.newLongRange(field, precisionStep, min, max, startInclusive, endInclusive);
-    } else if (analyzer instanceof DoubleAnalyzer) {
-      DoubleAnalyzer a = (DoubleAnalyzer) analyzer;
-      int precisionStep = a.getPrecisionStep();
-      double min = Double.parseDouble(part1);
-      double max = Double.parseDouble(part2);
-      return NumericRangeQuery.newDoubleRange(field, precisionStep, min, max, startInclusive, endInclusive);
-    } else if (analyzer instanceof FloatAnalyzer) {
-      FloatAnalyzer a = (FloatAnalyzer) analyzer;
-      int precisionStep = a.getPrecisionStep();
-      float min = Float.parseFloat(part1);
-      float max = Float.parseFloat(part2);
-      return NumericRangeQuery.newFloatRange(field, precisionStep, min, max, startInclusive, endInclusive);
-    } else if (analyzer instanceof IntegerAnalyzer) {
-      IntegerAnalyzer a = (IntegerAnalyzer) analyzer;
-      int precisionStep = a.getPrecisionStep();
-      int radix = a.getRadix();
-      int min = Integer.parseInt(part1, radix);
-      int max = Integer.parseInt(part2, radix);
-      return NumericRangeQuery.newIntRange(field, precisionStep, min, max, startInclusive, endInclusive);
-    }
-    return null;
-  }
-
-  public boolean isFullTextField(String fieldName) {
-    Boolean b = _fullTextFields.get(fieldName);
-    if (b != null) {
-      return b;
-    }
-    String cf = getColumnFamily(fieldName);
-    if (cf == null) {
-      return false;
-    }
-    b = _fullTextColumnFamilies.get(cf);
-    if (b != null) {
-      return b;
-    }
-    ColumnDefinition defaultDefinition = _analyzerDefinition.getDefaultDefinition();
-    if (defaultDefinition != null && defaultDefinition.fullTextIndex) {
-      return true;
-    }
-    return false;
-  }
-
-  public Store getStore(String indexName) {
-    Store store = _storeMap.get(indexName);
-    if (store == null) {
-      return Store.YES;
-    }
-    return store;
-  }
-
-  public Index getIndex(String indexName) {
-    return Index.ANALYZED_NO_NORMS;
-  }
-
-  public String toJSON() {
-    TMemoryBuffer trans = new TMemoryBuffer(1024);
-    TJSONProtocol protocol = new TJSONProtocol(trans);
-    try {
-      _analyzerDefinition.write(protocol);
-    } catch (TException e) {
-      throw new RuntimeException(e);
-    }
-    trans.close();
-    byte[] array = trans.getArray();
-    return new String(array, 0, trans.length());
-  }
-
-  private String getColumnFamily(String fieldName) {
-    int index = fieldName.indexOf('.');
-    if (index < 0) {
-      return null;
-    }
-    return fieldName.substring(0, index);
-  }
-
-  public AnalyzerDefinition getAnalyzerDefinition() {
-    return _analyzerDefinition;
-  }
-
-  public void close() {
-
-  }
-  
-  @Override
-  protected Analyzer getWrappedAnalyzer(String fieldName) {
-    Analyzer analyzer = getAnalyzer(fieldName);
-    return (analyzer != null) ? analyzer : _defaultAnalyzer;
-  }
-
-  @Override
-  protected TokenStreamComponents wrapComponents(String fieldName, TokenStreamComponents components) {
-    return components;
-  }
-
-  public static BlurAnalyzer create(File file) throws IOException {
-    FileInputStream inputStream = new FileInputStream(file);
-    try {
-      return create(inputStream);
-    } finally {
-      inputStream.close();
-    }
-  }
-
-  public static BlurAnalyzer create(InputStream inputStream) throws IOException {
-    TMemoryInputTransport trans = new TMemoryInputTransport(getBytes(inputStream));
-    TJSONProtocol protocol = new TJSONProtocol(trans);
-    AnalyzerDefinition analyzerDefinition = new AnalyzerDefinition();
-    try {
-      analyzerDefinition.read(protocol);
-    } catch (TException e) {
-      throw new RuntimeException(e);
-    }
-    trans.close();
-    return new BlurAnalyzer(analyzerDefinition);
-  }
-
-  public static BlurAnalyzer create(String jsonStr) throws IOException {
-    InputStream inputStream = new ByteArrayInputStream(jsonStr.getBytes());
-    try {
-      return create(inputStream);
-    } finally {
-      inputStream.close();
-    }
-  }
-
-  public static BlurAnalyzer create(Path path) throws IOException {
-    FileSystem fileSystem = FileSystem.get(path.toUri(), new Configuration());
-    FSDataInputStream inputStream = fileSystem.open(path);
-    try {
-      return create(inputStream);
-    } finally {
-      inputStream.close();
-    }
-  }
-
-  private static byte[] getBytes(InputStream inputStream) throws IOException {
-    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-    byte[] buffer = new byte[1024];
-    int num;
-    while ((num = inputStream.read(buffer)) != -1) {
-      outputStream.write(buffer, 0, num);
-    }
-    inputStream.close();
-    outputStream.close();
-    return outputStream.toByteArray();
-  }
-
-  private static void load(Map<String, Analyzer> analyzers, Map<String, ColumnFamilyDefinition> familyDefinitions, Map<String, Boolean> fullTextFields,
-      Map<String, Set<String>> subIndexNameLookups, Map<String, Store> storeMap, Map<String, Boolean> fullTextColumnFamilies, Map<String, TYPE> typeLookup) {
-    if (familyDefinitions != null) {
-      for (String family : familyDefinitions.keySet()) {
-        ColumnFamilyDefinition familyDefinition = familyDefinitions.get(family);
-        ColumnDefinition defaultDefinition = familyDefinition.getDefaultDefinition();
-        if (defaultDefinition != null) {
-          fullTextColumnFamilies.put(family, defaultDefinition.isFullTextIndex());
-        }
-        load(family, familyDefinition, analyzers, fullTextFields, subIndexNameLookups, storeMap, typeLookup);
-      }
-    }
-  }
-
-  private static void load(String family, ColumnFamilyDefinition familyDefinition, Map<String, Analyzer> analyzers, Map<String, Boolean> fullTextFields,
-      Map<String, Set<String>> subIndexNameLookups, Map<String, Store> storeMap, Map<String, TYPE> typeLookup) {
-    Map<String, ColumnDefinition> columnDefinitions = familyDefinition.getColumnDefinitions();
-    if (columnDefinitions != null) {
-      for (String column : columnDefinitions.keySet()) {
-        ColumnDefinition columnDefinition = columnDefinitions.get(column);
-        load(family, familyDefinition, column, columnDefinition, analyzers, fullTextFields, subIndexNameLookups, storeMap, typeLookup);
-      }
-    }
-  }
-
-  private static void load(String family, ColumnFamilyDefinition familyDefinition, String column, ColumnDefinition columnDefinition, Map<String, Analyzer> analyzers,
-      Map<String, Boolean> fullTextFields, Map<String, Set<String>> subIndexNameLookups, Map<String, Store> storeMap, Map<String, TYPE> typeLookup) {
-    Map<String, AlternateColumnDefinition> alternateColumnDefinitions = columnDefinition.getAlternateColumnDefinitions();
-    if (alternateColumnDefinitions != null) {
-      for (String subColumn : alternateColumnDefinitions.keySet()) {
-        AlternateColumnDefinition alternateColumnDefinition = alternateColumnDefinitions.get(subColumn);
-        load(family, familyDefinition, column, columnDefinition, subColumn, alternateColumnDefinition, analyzers, subIndexNameLookups, storeMap, typeLookup);
-      }
-    }
-    String fieldName = family + "." + column;
-    Analyzer analyzer = getAnalyzerByClassName(columnDefinition.getAnalyzerClassName(), aliases, fieldName, typeLookup);
-    analyzers.put(fieldName, analyzer);
-    if (columnDefinition.isFullTextIndex()) {
-      fullTextFields.put(fieldName, Boolean.TRUE);
-    } else {
-      fullTextFields.put(fieldName, Boolean.FALSE);
-    }
-  }
-
-  private static void load(String family, ColumnFamilyDefinition familyDefinition, String column, ColumnDefinition columnDefinition, String subColumn,
-      AlternateColumnDefinition alternateColumnDefinition, Map<String, Analyzer> analyzers, Map<String, Set<String>> subIndexNameLookups, Map<String, Store> storeMap,
-      Map<String, TYPE> typeLookup) {
-    String fieldName = family + "." + column + "." + subColumn;
-    Analyzer analyzer = getAnalyzerByClassName(alternateColumnDefinition.getAnalyzerClassName(), aliases, fieldName, typeLookup);
-    analyzers.put(fieldName, analyzer);
-    putStore(fieldName, Store.NO, storeMap);
-    addSubField(fieldName, subIndexNameLookups);
-  }
-
-  private static void putStore(String name, Store store, Map<String, Store> storeMap) {
-    storeMap.put(name, store);
-  }
-
-  @SuppressWarnings("unchecked")
-  private static Analyzer getAnalyzerByClassName(String className, Map<String, Class<? extends Analyzer>> aliases, String fieldName, Map<String, TYPE> typeLookup) {
-    Analyzer type = getType(className, fieldName, typeLookup);
-    if (type != null) {
-      return type;
-    }
-    try {
-      Class<? extends Analyzer> clazz = aliases.get(className);
-      if (clazz == null) {
-        clazz = (Class<? extends Analyzer>) Class.forName(className);
-      }
-      try {
-        return (Analyzer) clazz.newInstance();
-      } catch (Exception e) {
-        Constructor<?> constructor = clazz.getConstructor(new Class[] { Version.class });
-        return (Analyzer) constructor.newInstance(LUCENE_VERSION);
-      }
-    } catch (Exception e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  private static Analyzer getType(String typeStr, String fieldName, Map<String, TYPE> typeLookup) {
-    if (typeStr == null) {
-      return null;
-    }
-    String[] types = typeStr.split(",");
-    String type = types[0];
-    String typeUpper = type.toUpperCase();
-    if (!typeNameCache.contains(typeUpper)) {
-      return null;
-    }
-    TYPE t = TYPE.valueOf(typeUpper);
-    if (fieldName != null) {
-      typeLookup.put(fieldName, t);
-    }
-    switch (t) {
-    case LONG:
-      LongAnalyzer longAnalyzer = new LongAnalyzer();
-      if (types.length > 1) {
-        longAnalyzer.setPrecisionStep(Integer.parseInt(types[1]));
-      }
-      if (types.length > 2) {
-        longAnalyzer.setRadix(Integer.parseInt(types[2]));
-      }
-      return longAnalyzer;
-    case INTEGER:
-      IntegerAnalyzer integerAnalyzer = new IntegerAnalyzer();
-      if (types.length > 1) {
-        integerAnalyzer.setPrecisionStep(Integer.parseInt(types[1]));
-      }
-      if (types.length > 2) {
-        integerAnalyzer.setRadix(Integer.parseInt(types[2]));
-      }
-      return integerAnalyzer;
-    case FLOAT:
-      FloatAnalyzer floatAnalyzer = new FloatAnalyzer();
-      if (types.length > 1) {
-        floatAnalyzer.setPrecisionStep(Integer.parseInt(types[1]));
-      }
-      return floatAnalyzer;
-    case DOUBLE:
-      DoubleAnalyzer doubleAnalyzer = new DoubleAnalyzer();
-      if (types.length > 1) {
-        doubleAnalyzer.setPrecisionStep(Integer.parseInt(types[1]));
-      }
-      return doubleAnalyzer;
-    default:
-      break;
-    }
-    return null;
-  }
-
-  private static void addSubField(String name, Map<String, Set<String>> subIndexNameLookups) {
-    int lastIndexOf = name.lastIndexOf('.');
-    String mainFieldName = name.substring(0, lastIndexOf);
-    Set<String> set = subIndexNameLookups.get(mainFieldName);
-    if (set == null) {
-      set = new TreeSet<String>();
-      subIndexNameLookups.put(mainFieldName, set);
-    }
-    set.add(name);
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/analysis/DoubleAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/DoubleAnalyzer.java b/src/blur-core/src/main/java/org/apache/blur/analysis/DoubleAnalyzer.java
deleted file mode 100644
index 01abeae..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/analysis/DoubleAnalyzer.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.apache.blur.analysis;
-
-/**
- * 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.io.Reader;
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.NumericTokenStream;
-import org.apache.lucene.analysis.util.CharTokenizer;
-import org.apache.lucene.util.NumericUtils;
-import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
-
-public final class DoubleAnalyzer extends Analyzer {
-
-  public static int PRECISION_STEP_DEFAULT = NumericUtils.PRECISION_STEP_DEFAULT;
-  private int precisionStep;
-
-  public DoubleAnalyzer() {
-    this(PRECISION_STEP_DEFAULT);
-  }
-
-  public DoubleAnalyzer(int precisionStep) {
-    this.precisionStep = precisionStep;
-  }
-
-  public int getPrecisionStep() {
-    return precisionStep;
-  }
-
-  public void setPrecisionStep(int precisionStep) {
-    this.precisionStep = precisionStep;
-  }
-  @Override
-  protected TokenStreamComponents createComponents(String fieldName,
-      Reader reader) {
-    final CharTokenizer source = new CharTokenizer(LUCENE_VERSION, reader) {
-      @Override
-      protected boolean isTokenChar(int arg0) {
-        return true;
-      }
-    };
-
-    final double value;
-    try {
-      value = toDouble(reader);
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    }
-    final NumericTokenStream numericTokenStream = new NumericTokenStream(
-        precisionStep);
-    numericTokenStream.setDoubleValue(value);
-
-    return new TokenStreamComponents(source, numericTokenStream) {
-      public void setReader(Reader reader) throws IOException {
-        numericTokenStream.reset();
-        numericTokenStream.setDoubleValue(toDouble(reader));
-      }
-    };
-  }
-  private double toDouble(Reader reader) throws IOException {
-    StringBuilder builder = new StringBuilder(20);
-    int read;
-    while ((read = reader.read()) != -1) {
-      builder.append((char) read);
-    }
-    return Double.parseDouble(builder.toString());
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/analysis/FloatAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/FloatAnalyzer.java b/src/blur-core/src/main/java/org/apache/blur/analysis/FloatAnalyzer.java
deleted file mode 100644
index fb04888..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/analysis/FloatAnalyzer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.blur.analysis;
-
-/**
- * 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.io.Reader;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.NumericTokenStream;
-import org.apache.lucene.analysis.util.CharTokenizer;
-import org.apache.lucene.util.NumericUtils;
-import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
-
-public final class FloatAnalyzer extends Analyzer {
-
-  public static int PRECISION_STEP_DEFAULT = NumericUtils.PRECISION_STEP_DEFAULT;
-  private int precisionStep;
-
-  public FloatAnalyzer() {
-    this(PRECISION_STEP_DEFAULT);
-  }
-
-  public FloatAnalyzer(int precisionStep) {
-    this.precisionStep = precisionStep;
-  }
-
-  public int getPrecisionStep() {
-    return precisionStep;
-  }
-
-  public void setPrecisionStep(int precisionStep) {
-    this.precisionStep = precisionStep;
-  }
-
-  private float toFloat(Reader reader) throws IOException {
-    StringBuilder builder = new StringBuilder(20);
-    int read;
-    while ((read = reader.read()) != -1) {
-      builder.append((char) read);
-    }
-    return Float.parseFloat(builder.toString());
-  }
-  
-  @Override
-  protected TokenStreamComponents createComponents(String fieldName,
-      Reader reader) {
-    final CharTokenizer source = new CharTokenizer(LUCENE_VERSION, reader) {
-      @Override
-      protected boolean isTokenChar(int arg0) {
-        return true;
-      }
-    };
-
-    final float value;
-    try {
-      value = toFloat(reader);
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    }
-    final NumericTokenStream numericTokenStream = new NumericTokenStream(
-        precisionStep);
-    numericTokenStream.setFloatValue(value);
-
-    return new TokenStreamComponents(source, numericTokenStream) {
-      public void setReader(Reader reader) throws IOException {
-        numericTokenStream.reset();
-        numericTokenStream.setFloatValue(toFloat(reader));
-      }
-    };
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/analysis/IntegerAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/IntegerAnalyzer.java b/src/blur-core/src/main/java/org/apache/blur/analysis/IntegerAnalyzer.java
deleted file mode 100644
index f63330e..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/analysis/IntegerAnalyzer.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.apache.blur.analysis;
-
-/**
- * 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.io.Reader;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.NumericTokenStream;
-import org.apache.lucene.analysis.util.CharTokenizer;
-import org.apache.lucene.util.NumericUtils;
-import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
-
-public final class IntegerAnalyzer extends Analyzer {
-
-  public static int PRECISION_STEP_DEFAULT = NumericUtils.PRECISION_STEP_DEFAULT;
-  public static int RADIX_DEFAULT = 10;
-  private int radix = 10;
-  private int precisionStep;
-
-  public IntegerAnalyzer() {
-    this(PRECISION_STEP_DEFAULT, RADIX_DEFAULT);
-  }
-
-  public IntegerAnalyzer(int precisionStep) {
-    this(precisionStep, RADIX_DEFAULT);
-  }
-
-  public IntegerAnalyzer(int precisionStep, int radix) {
-    this.precisionStep = precisionStep;
-    this.radix = radix;
-  }
-
-  public int getRadix() {
-    return radix;
-  }
-
-  public void setRadix(int radix) {
-    this.radix = radix;
-  }
-
-  public int getPrecisionStep() {
-    return precisionStep;
-  }
-
-  public void setPrecisionStep(int precisionStep) {
-    this.precisionStep = precisionStep;
-  }
-
-  private int toInteger(Reader reader) throws IOException {
-    StringBuilder builder = new StringBuilder(20);
-    int read;
-    while ((read = reader.read()) != -1) {
-      builder.append((char) read);
-    }
-    return Integer.parseInt(builder.toString(), radix);
-  }
-  
-  @Override
-  protected TokenStreamComponents createComponents(String fieldName,
-      Reader reader) {
-    final CharTokenizer source = new CharTokenizer(LUCENE_VERSION, reader) {
-      @Override
-      protected boolean isTokenChar(int arg0) {
-        return true;
-      }
-    };
-
-    final int value;
-    try {
-      value = toInteger(reader);
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    }
-    final NumericTokenStream numericTokenStream = new NumericTokenStream(
-        precisionStep);
-    numericTokenStream.setIntValue(value);
-
-    return new TokenStreamComponents(source, numericTokenStream) {
-      public void setReader(Reader reader) throws IOException {
-        numericTokenStream.reset();
-        numericTokenStream.setIntValue(toInteger(reader));
-      }
-    };
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/analysis/LongAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/LongAnalyzer.java b/src/blur-core/src/main/java/org/apache/blur/analysis/LongAnalyzer.java
deleted file mode 100644
index b8d7a54..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/analysis/LongAnalyzer.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.apache.blur.analysis;
-
-/**
- * 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.io.Reader;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.NumericTokenStream;
-import org.apache.lucene.analysis.util.CharTokenizer;
-import org.apache.lucene.util.NumericUtils;
-import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
-
-public final class LongAnalyzer extends Analyzer {
-
-  public static int PRECISION_STEP_DEFAULT = NumericUtils.PRECISION_STEP_DEFAULT;
-  public static int RADIX_DEFAULT = 10;
-  private int radix = 10;
-  private int precisionStep;
-
-  public LongAnalyzer() {
-    this(PRECISION_STEP_DEFAULT, RADIX_DEFAULT);
-  }
-
-  public LongAnalyzer(int precisionStep) {
-    this(precisionStep, RADIX_DEFAULT);
-  }
-
-  public LongAnalyzer(int precisionStep, int radix) {
-    this.precisionStep = precisionStep;
-    this.radix = radix;
-  }
-
-  public int getRadix() {
-    return radix;
-  }
-
-  public void setRadix(int radix) {
-    this.radix = radix;
-  }
-
-  public int getPrecisionStep() {
-    return precisionStep;
-  }
-
-  public void setPrecisionStep(int precisionStep) {
-    this.precisionStep = precisionStep;
-  }
-
-  private long toLong(Reader reader) throws IOException {
-    StringBuilder builder = new StringBuilder(20);
-    int read;
-    while ((read = reader.read()) != -1) {
-      builder.append((char) read);
-    }
-    return Long.parseLong(builder.toString(), radix);
-  }
-  
-  @Override
-  protected TokenStreamComponents createComponents(String fieldName,
-      Reader reader) {
-    final CharTokenizer source = new CharTokenizer(LUCENE_VERSION, reader) {
-      @Override
-      protected boolean isTokenChar(int arg0) {
-        return true;
-      }
-    };
-
-    final long value;
-    try {
-      value = toLong(reader);
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    }
-    final NumericTokenStream numericTokenStream = new NumericTokenStream(
-        precisionStep);
-    numericTokenStream.setLongValue(value);
-
-    return new TokenStreamComponents(source, numericTokenStream) {
-      public void setReader(Reader reader) throws IOException {
-        numericTokenStream.reset();
-        numericTokenStream.setLongValue(toLong(reader));
-      }
-    };
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java
deleted file mode 100644
index f9c4c6b..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/AbstractWrapperQuery.java
+++ /dev/null
@@ -1,76 +0,0 @@
-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 abstract Query clone();
-
-  public abstract Weight createWeight(IndexSearcher searcher) throws IOException;
-
-  public boolean equals(Object obj) {
-    return _query.equals(obj);
-  }
-
-  public void extractTerms(Set<Term> terms) {
-    _query.extractTerms(terms);
-  }
-
-  public float getBoost() {
-    return _query.getBoost();
-  }
-
-  public Similarity getSimilarity(IndexSearcher searcher) {
-    return searcher.getSimilarity();
-  }
-
-  public int hashCode() {
-    return _query.hashCode();
-  }
-
-  public abstract Query rewrite(IndexReader reader) throws IOException;
-
-  public void setBoost(float b) {
-    _query.setBoost(b);
-  }
-
-  public abstract String toString();
-
-  public abstract String toString(String field);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/FacetQuery.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
deleted file mode 100644
index 1841fe9..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
+++ /dev/null
@@ -1,200 +0,0 @@
-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/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/FairSimilarity.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/FairSimilarity.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/FairSimilarity.java
deleted file mode 100644
index 8c8b945..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/FairSimilarity.java
+++ /dev/null
@@ -1,61 +0,0 @@
-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 org.apache.lucene.index.FieldInvertState;
-import org.apache.lucene.search.similarities.TFIDFSimilarity;
-import org.apache.lucene.util.BytesRef;
-
-public class FairSimilarity extends TFIDFSimilarity {
-
-  @Override
-  public float coord(int overlap, int maxOverlap) {
-    return 1;
-  }
-
-  @Override
-  public float idf(long docFreq, long numDocs) {
-    return 1;
-  }
-
-  @Override
-  public float queryNorm(float sumOfSquaredWeights) {
-    return 1;
-  }
-
-  @Override
-  public float sloppyFreq(int distance) {
-    return 1;
-  }
-
-  @Override
-  public float tf(float freq) {
-    return 1;
-  }
-
-  @Override
-  public float scorePayload(int doc, int start, int end, BytesRef payload) {
-    return 1;
-  }
-
-  @Override
-  public float lengthNorm(FieldInvertState fieldInvertState) {
-    throw new RuntimeException("not sure");
-//    return 0;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/IterablePaging.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/IterablePaging.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/IterablePaging.java
deleted file mode 100644
index 586b68a..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/IterablePaging.java
+++ /dev/null
@@ -1,227 +0,0 @@
-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.Iterator;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.search.TopScoreDocCollector;
-
-/**
- * The {@link IterablePaging} class allows for easy paging through lucene hits.
- */
-public class IterablePaging implements Iterable<ScoreDoc> {
-
-  private final IndexSearcher searcher;
-  private final Query query;
-  private final AtomicBoolean running;
-  private final int numHitsToCollect;
-
-  private TotalHitsRef totalHitsRef;
-  private ProgressRef progressRef;
-  private int skipTo;
-  private int gather = -1;
-
-  public IterablePaging(AtomicBoolean running, IndexSearcher searcher, Query query,
-      int numHitsToCollect, TotalHitsRef totalHitsRef, ProgressRef progressRef) throws IOException {
-    this.running = running;
-    this.query = searcher.rewrite(query);
-    this.searcher = searcher;
-    this.numHitsToCollect = numHitsToCollect;
-    this.totalHitsRef = totalHitsRef == null ? new TotalHitsRef() : totalHitsRef;
-    this.progressRef = progressRef == null ? new ProgressRef() : progressRef;
-
-  }
-
-  public static class TotalHitsRef {
-    // This is an atomic integer because more than likely if there is
-    // any status sent to the user, it will be done in another thread.
-    protected AtomicInteger totalHits = new AtomicInteger(0);
-
-    public int totalHits() {
-      return totalHits.get();
-    }
-  }
-
-  public static class ProgressRef {
-    // These are atomic integers because more than likely if there is
-    // any status sent to the user, it will be done in another thread.
-    protected AtomicInteger skipTo = new AtomicInteger(0);
-    protected AtomicInteger currentHitPosition = new AtomicInteger(0);
-    protected AtomicInteger searchesPerformed = new AtomicInteger(0);
-    protected AtomicLong queryTime = new AtomicLong(0);
-
-    public int skipTo() {
-      return skipTo.get();
-    }
-
-    public int currentHitPosition() {
-      return currentHitPosition.get();
-    }
-
-    public int searchesPerformed() {
-      return searchesPerformed.get();
-    }
-
-    public long queryTime() {
-      return queryTime.get();
-    }
-  }
-
-  /**
-   * Gets the total hits of the search.
-   * 
-   * @return the total hits.
-   */
-  public int getTotalHits() {
-    return totalHitsRef.totalHits();
-  }
-
-  /**
-   * Allows for gathering of the total hits of this search.
-   * 
-   * @param ref
-   *          {@link TotalHitsRef}.
-   * @return this.
-   */
-  public IterablePaging totalHits(TotalHitsRef ref) {
-    totalHitsRef = ref;
-    return this;
-  }
-
-  /**
-   * Skips the first x number of hits.
-   * 
-   * @param skipTo
-   *          the number hits to skip.
-   * @return this.
-   */
-  public IterablePaging skipTo(int skipTo) {
-    this.skipTo = skipTo;
-    return this;
-  }
-
-  /**
-   * Only gather up to x number of hits.
-   * 
-   * @param gather
-   *          the number of hits to gather.
-   * @return this.
-   */
-  public IterablePaging gather(int gather) {
-    this.gather = gather;
-    return this;
-  }
-
-  /**
-   * Allows for gathering the progress of the paging.
-   * 
-   * @param ref
-   *          the {@link ProgressRef}.
-   * @return this.
-   */
-  public IterablePaging progress(ProgressRef ref) {
-    this.progressRef = ref;
-    return this;
-  }
-
-  /**
-   * The {@link ScoreDoc} iterator.
-   */
-  @Override
-  public Iterator<ScoreDoc> iterator() {
-    return skipHits(new PagingIterator());
-  }
-
-  class PagingIterator implements Iterator<ScoreDoc> {
-    private ScoreDoc[] scoreDocs;
-    private int counter = 0;
-    private int offset = 0;
-    private int endPosition = gather == -1 ? Integer.MAX_VALUE : skipTo + gather;
-    private ScoreDoc lastScoreDoc;
-
-    PagingIterator() {
-      search();
-    }
-
-    void search() {
-      long s = System.currentTimeMillis();
-      progressRef.searchesPerformed.incrementAndGet();
-      try {
-        TopScoreDocCollector collector = TopScoreDocCollector.create(numHitsToCollect, lastScoreDoc, true);
-        StopExecutionCollector stopExecutionCollector = new StopExecutionCollector(collector, running);
-        searcher.search(query, stopExecutionCollector);
-        totalHitsRef.totalHits.set(collector.getTotalHits());
-        TopDocs topDocs = collector.topDocs();
-        scoreDocs = topDocs.scoreDocs;
-      } catch (IOException e) {
-        e.printStackTrace();
-        throw new RuntimeException(e);
-      }
-      if (scoreDocs.length > 0) {
-        lastScoreDoc = scoreDocs[scoreDocs.length - 1];
-      } else {
-        lastScoreDoc = null;
-      }
-      long e = System.currentTimeMillis();
-      progressRef.queryTime.addAndGet(e - s);
-    }
-
-    @Override
-    public boolean hasNext() {
-      return counter < totalHitsRef.totalHits() && counter < endPosition ? true : false;
-    }
-
-    @Override
-    public ScoreDoc next() {
-      if (isCurrentCollectorExhausted()) {
-        search();
-        offset = 0;
-      }
-      progressRef.currentHitPosition.set(counter);
-      counter++;
-      return scoreDocs[offset++];
-    }
-
-    private boolean isCurrentCollectorExhausted() {
-      return offset < scoreDocs.length ? false : true;
-    }
-
-    @Override
-    public void remove() {
-      throw new RuntimeException("read only");
-    }
-  }
-
-  private Iterator<ScoreDoc> skipHits(Iterator<ScoreDoc> iterator) {
-    progressRef.skipTo.set(skipTo);
-    for (int i = 0; i < skipTo && iterator.hasNext(); i++) {
-      // eats the hits, and moves the iterator to the desired skip to position.
-      progressRef.currentHitPosition.set(i);
-      iterator.next();
-    }
-    return iterator;
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/PagingCollector.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/PagingCollector.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/PagingCollector.java
deleted file mode 100644
index fec888c..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/PagingCollector.java
+++ /dev/null
@@ -1,116 +0,0 @@
-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.search.ScoreDoc;
-import org.apache.lucene.search.Scorer;
-import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.search.TopDocsCollector;
-import org.apache.lucene.util.PriorityQueue;
-
-/**
- * The {@link PagingCollector} allows for paging through lucene hits.
- */
-public class PagingCollector extends TopDocsCollector<ScoreDoc> {
-
-  private ScoreDoc pqTop;
-  private int docBase;
-  private Scorer scorer;
-  private ScoreDoc previousPassLowest;
-  private int numHits;
-
-  public PagingCollector(int numHits) {
-    // creates an empty score doc so that i don't have to check for null
-    // each time.
-    this(numHits, new ScoreDoc(-1, Float.MAX_VALUE));
-  }
-
-  public PagingCollector(int numHits, ScoreDoc previousPassLowest) {
-    super(new HitQueue(numHits, true));
-    this.pqTop = pq.top();
-    this.numHits = numHits;
-    this.previousPassLowest = previousPassLowest;
-  }
-
-  @Override
-  public boolean acceptsDocsOutOfOrder() {
-    return true;
-  }
-
-  @Override
-  public void collect(int doc) throws IOException {
-    float score = scorer.score();
-    totalHits++;
-    doc += docBase;
-    if (score > previousPassLowest.score) {
-      // this hit was gathered on a previous page.
-      return;
-    } else if (score == previousPassLowest.score && doc <= previousPassLowest.doc) {
-      // if the scores are the same and the doc is less than or equal to the
-      // previous pass lowest hit doc then skip because this collector favors
-      // lower number documents.
-      return;
-    } else if (score < pqTop.score || (score == pqTop.score && doc > pqTop.doc)) {
-      return;
-    }
-    pqTop.doc = doc;
-    pqTop.score = score;
-    pqTop = pq.updateTop();
-  }
-
-  @Override
-  public void setNextReader(AtomicReaderContext context) throws IOException {
-    this.docBase = context.docBase;
-  }
-
-  @Override
-  public void setScorer(Scorer scorer) throws IOException {
-    this.scorer = scorer;
-  }
-
-  public ScoreDoc getLastScoreDoc(TopDocs topDocs) {
-    return topDocs.scoreDocs[(totalHits < numHits ? totalHits : numHits) - 1];
-  }
-
-  public ScoreDoc getLastScoreDoc(ScoreDoc[] scoreDocs) {
-    return scoreDocs[(totalHits < numHits ? totalHits : numHits) - 1];
-  }
-
-  public static class HitQueue extends PriorityQueue<ScoreDoc> {
-
-    HitQueue(int size, boolean prePopulate) {
-      super(size, prePopulate);
-    }
-
-    @Override
-    protected ScoreDoc getSentinelObject() {
-      return new ScoreDoc(Integer.MAX_VALUE, Float.NEGATIVE_INFINITY);
-    }
-
-    @Override
-    protected final boolean lessThan(ScoreDoc hitA, ScoreDoc hitB) {
-      if (hitA.score == hitB.score)
-        return hitA.doc > hitB.doc;
-      else
-        return hitA.score < hitB.score;
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java
deleted file mode 100644
index d97a14f..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/StopExecutionCollector.java
+++ /dev/null
@@ -1,67 +0,0 @@
-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/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperParser.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperParser.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperParser.java
deleted file mode 100644
index b97124f..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperParser.java
+++ /dev/null
@@ -1,245 +0,0 @@
-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 static org.apache.blur.utils.BlurConstants.SUPER;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.blur.analysis.BlurAnalyzer;
-import org.apache.blur.analysis.BlurAnalyzer.TYPE;
-import org.apache.blur.thrift.generated.ScoreType;
-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;
-import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.Filter;
-import org.apache.lucene.search.FilteredQuery;
-import org.apache.lucene.search.MatchAllDocsQuery;
-import org.apache.lucene.search.MultiPhraseQuery;
-import org.apache.lucene.search.PhraseQuery;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.util.Version;
-
-public class SuperParser extends QueryParser {
-
-  private final Map<Query, String> fieldNames = new HashMap<Query, String>();
-  private final boolean superSearch;
-  private final Filter queryFilter;
-  private final ScoreType scoreType;
-  private final BlurAnalyzer blurAnalyzer;
-
-  public SuperParser(Version matchVersion, BlurAnalyzer a, boolean superSearch, Filter queryFilter, ScoreType scoreType) {
-    super(matchVersion, SUPER, a);
-    this.setAutoGeneratePhraseQueries(true);
-    this.setAllowLeadingWildcard(true);
-    this.superSearch = superSearch;
-    this.queryFilter = queryFilter;
-    this.scoreType = scoreType;
-    this.blurAnalyzer = a;
-  }
-
-  @Override
-  public Query parse(String query) throws ParseException {
-    return reprocess(super.parse(query));
-  }
-
-  @Override
-  protected Query newFuzzyQuery(Term term, float minimumSimilarity, int prefixLength) {
-    String field = term.field();
-    TYPE type = blurAnalyzer.getTypeLookup(field);
-    if (type != TYPE.DEFAULT) {
-      throw new RuntimeException("Field [" + field + "] is type [" + type + "] which does not support fuzzy queries.");
-    }
-    return addField(super.newFuzzyQuery(term, minimumSimilarity, prefixLength), term.field());
-  }
-
-  @Override
-  protected Query newMatchAllDocsQuery() {
-    return addField(super.newMatchAllDocsQuery(), UUID.randomUUID().toString());
-  }
-
-  @Override
-  protected MultiPhraseQuery newMultiPhraseQuery() {
-    return new MultiPhraseQuery() {
-
-      @Override
-      public void add(Term[] terms, int position) {
-        super.add(terms, position);
-        for (Term term : terms) {
-          addField(this, term.field());
-        }
-      }
-    };
-  }
-
-  @Override
-  protected PhraseQuery newPhraseQuery() {
-    return new PhraseQuery() {
-
-      @Override
-      public void add(Term term, int position) {
-        super.add(term, position);
-        addField(this, term.field());
-      }
-    };
-  }
-
-  @Override
-  protected Query newPrefixQuery(Term prefix) {
-    String field = prefix.field();
-    TYPE type = blurAnalyzer.getTypeLookup(field);
-    if (type != TYPE.DEFAULT) {
-      throw new RuntimeException("Field [" + field + "] is type [" + type + "] which does not support prefix queries.");
-    }
-    return addField(super.newPrefixQuery(prefix), field);
-  }
-
-  @Override
-  protected Query newRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) {
-    Query q = blurAnalyzer.getNewRangeQuery(field, part1, part2, startInclusive, endInclusive);
-    if (q != null) {
-      return addField(q, field);
-    }
-    return addField(super.newRangeQuery(field, part1, part2, startInclusive, endInclusive), field);
-  }
-
-  @Override
-  protected Query newTermQuery(Term term) {
-    String field = term.field();
-    Query q = blurAnalyzer.getNewRangeQuery(field, term.text(), term.text(), true, true);
-    if (q != null) {
-      return addField(q, field);
-    }
-    return addField(super.newTermQuery(term), field);
-  }
-
-  @Override
-  protected Query newWildcardQuery(Term t) {
-    if (SUPER.equals(t.field()) && "*".equals(t.text())) {
-      return new MatchAllDocsQuery();
-    }
-    String field = t.field();
-    TYPE type = blurAnalyzer.getTypeLookup(field);
-    if (type != TYPE.DEFAULT) {
-      throw new RuntimeException("Field [" + field + "] is type [" + type + "] which does not support wildcard queries.");
-    }
-    return addField(super.newWildcardQuery(t), t.field());
-  }
-
-  private Query reprocess(Query query) {
-    if (query == null || !isSuperSearch()) {
-      return wrapFilter(query);
-    }
-    if (query instanceof BooleanQuery) {
-      BooleanQuery booleanQuery = (BooleanQuery) query;
-      List<BooleanClause> clauses = booleanQuery.clauses();
-      for (BooleanClause bc : clauses) {
-        Query q = bc.getQuery();
-        bc.setQuery(newSuperQuery(q));
-      }
-      return booleanQuery;
-
-      // if (isSameGroupName(booleanQuery)) {
-      // return newSuperQuery(query);
-      // } else {
-      // List<BooleanClause> clauses = booleanQuery.clauses();
-      // for (BooleanClause clause : clauses) {
-      // clause.setQuery(reprocess(clause.getQuery()));
-      // }
-      // return booleanQuery;
-      // }
-    } else {
-      return newSuperQuery(query);
-    }
-  }
-
-  private SuperQuery newSuperQuery(Query query) {
-    return new SuperQuery(wrapFilter(query), scoreType);
-  }
-
-  private Query wrapFilter(Query query) {
-    if (queryFilter == null) {
-      return query;
-    }
-    return new FilteredQuery(query, queryFilter);
-  }
-
-  // private boolean isSameGroupName(BooleanQuery booleanQuery) {
-  // String groupName = findFirstGroupName(booleanQuery);
-  // if (groupName == null) {
-  // return false;
-  // }
-  // return isSameGroupName(booleanQuery, groupName);
-  // }
-  //
-  // private boolean isSameGroupName(Query query, String groupName) {
-  // if (query instanceof BooleanQuery) {
-  // BooleanQuery booleanQuery = (BooleanQuery) query;
-  // for (BooleanClause clause : booleanQuery.clauses()) {
-  // if (!isSameGroupName(clause.getQuery(), groupName)) {
-  // return false;
-  // }
-  // }
-  // return true;
-  // } else {
-  // String fieldName = fieldNames.get(query);
-  // String currentGroupName = getGroupName(fieldName);
-  // if (groupName.equals(currentGroupName)) {
-  // return true;
-  // }
-  // return false;
-  // }
-  // }
-  //
-  // private String getGroupName(String fieldName) {
-  // if (fieldName == null) {
-  // return null;
-  // }
-  // int index = fieldName.indexOf(SEP);
-  // if (index < 0) {
-  // return null;
-  // }
-  // return fieldName.substring(0, index);
-  // }
-  //
-  // private String findFirstGroupName(Query query) {
-  // if (query instanceof BooleanQuery) {
-  // BooleanQuery booleanQuery = (BooleanQuery) query;
-  // for (BooleanClause clause : booleanQuery.clauses()) {
-  // return findFirstGroupName(clause.getQuery());
-  // }
-  // return null;
-  // } else {
-  // String fieldName = fieldNames.get(query);
-  // return getGroupName(fieldName);
-  // }
-  // }
-
-  private Query addField(Query q, String field) {
-    fieldNames.put(q, field);
-    return q;
-  }
-
-  public boolean isSuperSearch() {
-    return superSearch;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperQuery.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
deleted file mode 100644
index fc24d21..0000000
--- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
+++ /dev/null
@@ -1,276 +0,0 @@
-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.blur.thrift.generated.ScoreType;
-import org.apache.blur.utils.PrimeDocCache;
-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;
-import org.apache.lucene.util.OpenBitSet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SuperQuery extends AbstractWrapperQuery {
-
-  private ScoreType scoreType;
-
-  public SuperQuery(Query query, ScoreType scoreType) {
-    super(query, false);
-    this.scoreType = scoreType;
-  }
-
-  public SuperQuery(Query query, ScoreType scoreType, boolean rewritten) {
-    super(query, rewritten);
-    this.scoreType = scoreType;
-  }
-
-  public Query clone() {
-    return new SuperQuery((Query) _query.clone(), scoreType, _rewritten);
-  }
-
-  public Weight createWeight(IndexSearcher searcher) throws IOException {
-    Weight weight = _query.createWeight(searcher);
-    return new SuperWeight(weight, _query.toString(), this, scoreType);
-  }
-
-  public Query rewrite(IndexReader reader) throws IOException {
-    if (_rewritten) {
-      return this;
-    }
-    return new SuperQuery(_query.rewrite(reader), scoreType, true);
-  }
-
-  public String toString() {
-    return "super:{" + _query.toString() + "}";
-  }
-
-  public String toString(String field) {
-    return "super:{" + _query.toString(field) + "}";
-  }
-
-  public static class SuperWeight extends Weight {
-
-    private Weight weight;
-    private String originalQueryStr;
-    private Query query;
-    private ScoreType scoreType;
-
-    public SuperWeight(Weight weight, String originalQueryStr, Query query, ScoreType scoreType) {
-      this.weight = weight;
-      this.originalQueryStr = originalQueryStr;
-      this.query = query;
-      this.scoreType = scoreType;
-    }
-
-    @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(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 Scorer scorer;
-    private OpenBitSet bitSet;
-    private int nextPrimeDoc;
-    private int primeDoc = -1;
-    private String originalQueryStr;
-    private ScoreType scoreType;
-
-    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/c1231e34/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
index 23ac2c8..0e82f57 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
@@ -49,6 +49,7 @@ import org.apache.blur.concurrent.Executors;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.lucene.search.FacetQuery;
+import org.apache.blur.manager.clusterstatus.ClusterStatus;
 import org.apache.blur.manager.results.BlurResultIterable;
 import org.apache.blur.manager.results.BlurResultIterableSearcher;
 import org.apache.blur.manager.results.MergerBlurResultIterable;
@@ -56,6 +57,7 @@ import org.apache.blur.manager.status.QueryStatus;
 import org.apache.blur.manager.status.QueryStatusManager;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.server.IndexSearcherClosable;
+import org.apache.blur.server.TableContext;
 import org.apache.blur.thrift.BException;
 import org.apache.blur.thrift.MutationHelper;
 import org.apache.blur.thrift.generated.BlurException;
@@ -118,6 +120,7 @@ public class IndexManager {
   private static final Log LOG = LogFactory.getLog(IndexManager.class);
 
   private IndexServer _indexServer;
+  private ClusterStatus _clusterStatus;
   private ExecutorService _executor;
   private ExecutorService _mutateExecutor;
   private int _threadCount;
@@ -336,15 +339,16 @@ public class IndexManager {
       }
       BlurAnalyzer analyzer = _indexServer.getAnalyzer(table);
       ParallelCall<Entry<String, BlurIndex>, BlurResultIterable> call;
+      TableContext context = getTableContext(table);
       if (isSimpleQuery(blurQuery)) {
         SimpleQuery simpleQuery = blurQuery.simpleQuery;
         Filter preFilter = QueryParserUtil
-            .parseFilter(table, simpleQuery.preSuperFilter, false, analyzer, _filterCache);
+            .parseFilter(table, simpleQuery.preSuperFilter, false, analyzer, _filterCache, context);
         Filter postFilter = QueryParserUtil.parseFilter(table, simpleQuery.postSuperFilter, true, analyzer,
-            _filterCache);
+            _filterCache, context);
         Query userQuery = QueryParserUtil.parseQuery(simpleQuery.queryStr, simpleQuery.superQueryOn, analyzer,
-            postFilter, preFilter, getScoreType(simpleQuery.type));
-        Query facetedQuery = getFacetedQuery(blurQuery, userQuery, facetedCounts, analyzer);
+            postFilter, preFilter, getScoreType(simpleQuery.type), context);
+        Query facetedQuery = getFacetedQuery(blurQuery, userQuery, facetedCounts, analyzer, context);
         call = new SimpleQueryParallelCall(running, table, status, _indexServer, facetedQuery, blurQuery.selector,
             _queriesInternalMeter);
       } else {
@@ -356,7 +360,7 @@ public class IndexManager {
         } else {
           userQuery = query;
         }
-        Query facetedQuery = getFacetedQuery(blurQuery, userQuery, facetedCounts, analyzer);
+        Query facetedQuery = getFacetedQuery(blurQuery, userQuery, facetedCounts, analyzer, context);
         call = new SimpleQueryParallelCall(running, table, status, _indexServer, facetedQuery, blurQuery.selector,
             _queriesInternalMeter);
       }
@@ -372,6 +376,10 @@ public class IndexManager {
     }
   }
 
+  private TableContext getTableContext(final String table) {
+    return TableContext.create(_clusterStatus.getTableDescriptor(true, _clusterStatus.getCluster(true, table), table));
+  }
+
   private Filter getFilter(ExpertQuery expertQuery) throws BException {
     throw new BException("Expert query not supported", new Throwable());
   }
@@ -387,20 +395,20 @@ public class IndexManager {
     return false;
   }
 
-  private Query getFacetedQuery(BlurQuery blurQuery, Query userQuery, AtomicLongArray counts, BlurAnalyzer analyzer)
+  private Query getFacetedQuery(BlurQuery blurQuery, Query userQuery, AtomicLongArray counts, BlurAnalyzer analyzer, TableContext context)
       throws ParseException {
     if (blurQuery.facets == null) {
       return userQuery;
     }
-    return new FacetQuery(userQuery, getFacetQueries(blurQuery, analyzer), counts);
+    return new FacetQuery(userQuery, getFacetQueries(blurQuery, analyzer, context), counts);
   }
 
-  private Query[] getFacetQueries(BlurQuery blurQuery, BlurAnalyzer analyzer) throws ParseException {
+  private Query[] getFacetQueries(BlurQuery blurQuery, BlurAnalyzer analyzer, TableContext context) throws ParseException {
     int size = blurQuery.facets.size();
     Query[] queries = new Query[size];
     for (int i = 0; i < size; i++) {
       queries[i] = QueryParserUtil.parseQuery(blurQuery.facets.get(i).queryStr, blurQuery.simpleQuery.superQueryOn,
-          analyzer, null, null, ScoreType.CONSTANT);
+          analyzer, null, null, ScoreType.CONSTANT, context);
     }
     return queries;
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c1231e34/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 469431a..651b435 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
@@ -20,25 +20,28 @@ import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 
 import org.apache.blur.analysis.BlurAnalyzer;
 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 {
 
-  public static Query parseQuery(String query, boolean superQueryOn, BlurAnalyzer analyzer, Filter postFilter, Filter preFilter, ScoreType scoreType) throws ParseException   {
-    Query result = new SuperParser(LUCENE_VERSION, analyzer, superQueryOn, preFilter, scoreType).parse(query);
+  public static Query parseQuery(String query, boolean superQueryOn, BlurAnalyzer analyzer, Filter postFilter, Filter preFilter, ScoreType scoreType, TableContext tableContext) throws ParseException   {
+    Query result = new SuperParser(LUCENE_VERSION, analyzer,superQueryOn, preFilter,  scoreType, tableContext.getDefaultPrimeDocTerm()).parse(query);
     if (postFilter == null) {
       return result;
     }
     return new FilteredQuery(result, postFilter);
   }
 
-  public static Filter parseFilter(String table, String filterStr, boolean superQueryOn, BlurAnalyzer analyzer, BlurFilterCache filterCache) throws ParseException, BlurException {
+  public static Filter parseFilter(String table, String filterStr, boolean superQueryOn, BlurAnalyzer analyzer, BlurFilterCache filterCache, TableContext tableContext) throws ParseException, BlurException {
     if (filterStr == null) {
       return null;
     }
@@ -52,7 +55,7 @@ public class QueryParserUtil {
       if (filter != null) {
         return filter;
       }
-      filter = new QueryWrapperFilter(new SuperParser(LUCENE_VERSION, analyzer, superQueryOn, null, ScoreType.CONSTANT).parse(filterStr));
+      filter = new QueryWrapperFilter(new SuperParser(LUCENE_VERSION, analyzer, superQueryOn, null,  ScoreType.CONSTANT, tableContext.getDefaultPrimeDocTerm()).parse(filterStr));
       if (superQueryOn) {
         filter = filterCache.storePostFilter(table, filterStr, filter);
       } else {


Mime
View raw message