Package org.apache.lucene.search
Class Explanation
- java.lang.Object
-
- org.apache.lucene.search.Explanation
-
public final class Explanation extends java.lang.ObjectExpert: Describes the score computation for document and query.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringdescriptionprivate java.util.List<Explanation>detailsprivate booleanmatchprivate java.lang.Numbervalue
-
Constructor Summary
Constructors Modifier Constructor Description privateExplanation(boolean match, java.lang.Number value, java.lang.String description, java.util.Collection<Explanation> details)Create a new explanation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetDescription()A description of this explanation node.Explanation[]getDetails()The sub-nodes of this explanation node.private java.lang.StringgetSummary()java.lang.NumbergetValue()The value assigned to this explanation node.inthashCode()booleanisMatch()Indicates whether or not this Explanation models a match.static Explanationmatch(java.lang.Number value, java.lang.String description, java.util.Collection<Explanation> details)Create a new explanation for a match.static Explanationmatch(java.lang.Number value, java.lang.String description, Explanation... details)Create a new explanation for a match.static ExplanationnoMatch(java.lang.String description, java.util.Collection<Explanation> details)Create a new explanation for a document which does not match.static ExplanationnoMatch(java.lang.String description, Explanation... details)Create a new explanation for a document which does not match.java.lang.StringtoString()Render an explanation as text.private java.lang.StringtoString(int depth)
-
-
-
Field Detail
-
match
private final boolean match
-
value
private final java.lang.Number value
-
description
private final java.lang.String description
-
details
private final java.util.List<Explanation> details
-
-
Constructor Detail
-
Explanation
private Explanation(boolean match, java.lang.Number value, java.lang.String description, java.util.Collection<Explanation> details)Create a new explanation
-
-
Method Detail
-
match
public static Explanation match(java.lang.Number value, java.lang.String description, java.util.Collection<Explanation> details)
Create a new explanation for a match.- Parameters:
value- the contribution to the score of the documentdescription- howvaluewas computeddetails- sub explanations that contributed to this explanation
-
match
public static Explanation match(java.lang.Number value, java.lang.String description, Explanation... details)
Create a new explanation for a match.- Parameters:
value- the contribution to the score of the documentdescription- howvaluewas computeddetails- sub explanations that contributed to this explanation
-
noMatch
public static Explanation noMatch(java.lang.String description, java.util.Collection<Explanation> details)
Create a new explanation for a document which does not match.
-
noMatch
public static Explanation noMatch(java.lang.String description, Explanation... details)
Create a new explanation for a document which does not match.
-
isMatch
public boolean isMatch()
Indicates whether or not this Explanation models a match.
-
getValue
public java.lang.Number getValue()
The value assigned to this explanation node.
-
getDescription
public java.lang.String getDescription()
A description of this explanation node.
-
getSummary
private java.lang.String getSummary()
-
getDetails
public Explanation[] getDetails()
The sub-nodes of this explanation node.
-
toString
public java.lang.String toString()
Render an explanation as text.- Overrides:
toStringin classjava.lang.Object
-
toString
private java.lang.String toString(int depth)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-