mikemccand commented on a change in pull request #2097:
URL: https://github.com/apache/lucene-solr/pull/2097#discussion_r542492206



##########
File path: lucene/core/src/java/org/apache/lucene/search/IndriQuery.java
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+package org.apache.lucene.search;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * A Basic abstract query that all IndriQueries can extend to implement
+ * toString, equals, getClauses, and iterator.
+ *
+ */
+public abstract class IndriQuery extends Query

Review comment:
       Random question: will `IndriQuery` take advantage of Block MAX Weak And 
optimization?  The added `smoothingScore` must alter the optimization logic to 
find the min block score to skip to?
   
   I think it's OK to defer BMW to followon improvements, as long as it is not 
kicking in incorrectly here.

##########
File path: lucene/core/src/java/org/apache/lucene/search/ScoreAndDoc.java
##########
@@ -32,4 +33,9 @@ public int docID() {
   public float score() {
     return score;
   }
+
+  @Override
+  public float smoothingScore(int docId) throws IOException {

Review comment:
       Hmm, why not add a default method in the `Scorable` interface to `return 
0`?  Then we don't have to add this default method in all these subclasses?

##########
File path: lucene/core/src/java/org/apache/lucene/search/Scorable.java
##########
@@ -30,6 +30,13 @@
    * Returns the score of the current document matching the query.
    */
   public abstract float score() throws IOException;
+  
+  /**
+   * Returns the smoothing score of the current document matching the query.
+   * This score is used when the query/term does not appear in the document.
+   * This can return 0 or a smoothing score.

Review comment:
       Great, thanks.

##########
File path: lucene/core/src/java/org/apache/lucene/search/IndriAndQuery.java
##########
@@ -0,0 +1,22 @@
+package org.apache.lucene.search;
+
+import java.io.IOException;
+import java.util.List;
+
+/** A Query that matches documents matching combinations of 
+ * {@link TermQuery}s or other IndriAndQuerys.
+ */
+public class IndriAndQuery extends IndriQuery {

Review comment:
       OK let's keep the (somewhat confusing) naming for now.  Naming is the 
hardest part!!

##########
File path: lucene/core/src/java/org/apache/lucene/search/IndriAndQuery.java
##########
@@ -0,0 +1,22 @@
+package org.apache.lucene.search;
+
+import java.io.IOException;
+import java.util.List;
+
+/** A Query that matches documents matching combinations of 
+ * {@link TermQuery}s or other IndriAndQuerys.
+ */
+public class IndriAndQuery extends IndriQuery {
+  
+  public IndriAndQuery(List<BooleanClause> clauses) {

Review comment:
       Hello, any comment on this one?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to