You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2012/11/20 13:29:43 UTC

svn commit: r1411642 - /lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/IntervalFilterQuery.java

Author: romseygeek
Date: Tue Nov 20 12:29:43 2012
New Revision: 1411642

URL: http://svn.apache.org/viewvc?rev=1411642&view=rev
Log:
LUCENE-4551: Implement explain() on IntervalFilterQuery.PositionFilterWeight

Modified:
    lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/IntervalFilterQuery.java

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/IntervalFilterQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/IntervalFilterQuery.java?rev=1411642&r1=1411641&r2=1411642&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/IntervalFilterQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/IntervalFilterQuery.java Tue Nov 20 12:29:43 2012
@@ -123,11 +123,18 @@ public class IntervalFilterQuery extends
         throws IOException {
       Scorer scorer = scorer(context, true, false, PostingFeatures.POSITIONS,
                               context.reader().getLiveDocs());
-      // nocommit - need to add in IntervalFilter details...
       if (scorer != null) {
         int newDoc = scorer.advance(doc);
         if (newDoc == doc) {
-          return other.explain(context, doc);
+          float freq = scorer.freq();
+          Similarity.SloppySimScorer docScorer = similarity.sloppySimScorer(stats, context);
+          ComplexExplanation result = new ComplexExplanation();
+          result.setDescription("weight("+getQuery()+" in "+doc+") [" + similarity.getClass().getSimpleName() + "], result of:");
+          Explanation scoreExplanation = docScorer.explain(doc, new Explanation(freq, "phraseFreq=" + freq));
+          result.addDetail(scoreExplanation);
+          result.setValue(scoreExplanation.getValue());
+          result.setMatch(true);
+          return result;
         }
       }
       return new ComplexExplanation(false, 0.0f,