incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/3] git commit: Minor changes due to the query objects in Lucene are no longer Serializable.
Date Thu, 18 Oct 2012 01:19:45 GMT
Updated Branches:
  refs/heads/lucene-4.0.0 86cc7fcd7 -> 8b4853769


Minor changes due to the query objects in Lucene are no longer Serializable.


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

Branch: refs/heads/lucene-4.0.0
Commit: 8b48537691cee43996eb76e022948d7c72d774b6
Parents: d699cf0
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed Oct 17 21:11:28 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Oct 17 21:11:28 2012 -0400

----------------------------------------------------------------------
 .../blur/lucene/search/AbstractWrapperQuery.java   |    7 -
 .../org/apache/blur/lucene/search/FacetQuery.java  |    7 -
 .../apache/blur/lucene/search/FairSimilarity.java  |    5 +-
 .../apache/blur/lucene/search/PagingCollector.java |    1 -
 .../blur/lucene/search/StopExecutionCollector.java |    1 -
 .../org/apache/blur/lucene/search/SuperParser.java |  102 +++++++--------
 .../org/apache/blur/lucene/search/SuperQuery.java  |   23 ++--
 7 files changed, 61 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8b485376/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
index e142fd7..f9c4c6b 100644
--- 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
@@ -27,7 +27,6 @@ import org.apache.lucene.search.Weight;
 import org.apache.lucene.search.similarities.Similarity;
 
 public abstract class AbstractWrapperQuery extends Query {
-  private static final long serialVersionUID = -4512813621542220044L;
   protected Query _query;
   protected boolean _rewritten;
 
@@ -42,12 +41,6 @@ public abstract class AbstractWrapperQuery extends Query {
 
   public abstract Query clone();
 
-  /*This method removed from parent class. Need to implement in different way if required.
-   * public Query combine(Query[] queries) {
-    
-    return _query.combine(queries);
-  }*/
-
   public abstract Weight createWeight(IndexSearcher searcher) throws IOException;
 
   public boolean equals(Object obj) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8b485376/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
index 2ef5142..38cc866 100644
--- 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
@@ -30,7 +30,6 @@ import org.apache.lucene.util.Bits;
 
 public class FacetQuery extends AbstractWrapperQuery {
 
-  private static final long serialVersionUID = -9131606859383383004L;
   private Query[] facets;
   private AtomicLongArray counts;
 
@@ -86,7 +85,6 @@ public class FacetQuery extends AbstractWrapperQuery {
 
   public static class FacetWeight extends Weight {
 
-    private static final long serialVersionUID = -5649908738708119094L;
     private Weight weight;
     private Weight[] facets;
     private AtomicLongArray counts;
@@ -107,11 +105,6 @@ public class FacetQuery extends AbstractWrapperQuery {
       return weight.getQuery();
     }
 
-   /*This method needs to implement in some other way Weight doesn't provide this method
at all
-    *  public float getValue() {
-      return weight.getQuery());
-    }*/
-
     @Override
     public void normalize(float norm, float topLevelBoost) {
       weight.normalize(norm, topLevelBoost);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8b485376/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
index 4ddfa22..dc8f59a 100644
--- 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
@@ -23,8 +23,6 @@ import org.apache.lucene.util.BytesRef;
 
 public class FairSimilarity extends TFIDFSimilarity {
 
-  private static final long serialVersionUID = 8819964136561756067L;
-
   @Override
   public float coord(int overlap, int maxOverlap) {
     return 1;
@@ -56,8 +54,7 @@ public class FairSimilarity extends TFIDFSimilarity {
 
   @Override
   public float scorePayload(int doc, int start, int end, BytesRef payload) {
-    // TODO Auto-generated method stub
-    return 0;
+    return 1;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8b485376/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
index c55c6f7..385c29d 100644
--- 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
@@ -19,7 +19,6 @@ package org.apache.blur.lucene.search;
 import java.io.IOException;
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.TopDocs;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8b485376/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
index 4e2b150..d97a14f 100644
--- 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
@@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8b485376/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
index c05b9eb..b97124f 100644
--- 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
@@ -80,7 +80,6 @@ public class SuperParser extends QueryParser {
   @Override
   protected MultiPhraseQuery newMultiPhraseQuery() {
     return new MultiPhraseQuery() {
-      private static final long serialVersionUID = 2743009696906520410L;
 
       @Override
       public void add(Term[] terms, int position) {
@@ -95,7 +94,6 @@ public class SuperParser extends QueryParser {
   @Override
   protected PhraseQuery newPhraseQuery() {
     return new PhraseQuery() {
-      private static final long serialVersionUID = 1927750709523859808L;
 
       @Override
       public void add(Term term, int position) {
@@ -185,56 +183,56 @@ public class SuperParser extends QueryParser {
     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 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);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8b485376/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
index b340d1e..69bf4c6 100644
--- 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
@@ -32,10 +32,8 @@ import org.apache.lucene.util.OpenBitSet;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 public class SuperQuery extends AbstractWrapperQuery {
 
-  private static final long serialVersionUID = -5901574044714034398L;
   private ScoreType scoreType;
 
   public SuperQuery(Query query, ScoreType scoreType) {
@@ -74,8 +72,6 @@ public class SuperQuery extends AbstractWrapperQuery {
 
   public static class SuperWeight extends Weight {
 
-    private static final long serialVersionUID = -4832849792097064960L;
-
     private Weight weight;
     private String originalQueryStr;
     private Query query;
@@ -94,14 +90,16 @@ public class SuperQuery extends AbstractWrapperQuery {
     }
 
     @Override
-    public Explanation explain(AtomicReaderContext context, int doc) throws IOException{
+    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();
-    }*/
+
+    /*
+     * 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) {
@@ -109,8 +107,7 @@ public class SuperQuery extends AbstractWrapperQuery {
     }
 
     @Override
-    public Scorer scorer(AtomicReaderContext context, boolean scoreDocsInOrder,
-        boolean topScorer, Bits acceptDocs) throws IOException {
+    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;
@@ -120,7 +117,7 @@ public class SuperQuery extends AbstractWrapperQuery {
     }
 
     @Override
-    public float getValueForNormalization() throws IOException{
+    public float getValueForNormalization() throws IOException {
       return weight.getValueForNormalization();
     }
 


Mime
View raw message