- java.lang.Object
-
- org.apache.lucene.search.Explanation
-
public final class Explanation extends java.lang.Object
Expert: Describes the score computation for document and query.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
description
private java.util.List<Explanation>
details
private boolean
match
private java.lang.Number
value
-
Constructor Summary
Constructors Modifier Constructor Description private
Explanation(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 boolean
equals(java.lang.Object o)
java.lang.String
getDescription()
A description of this explanation node.Explanation[]
getDetails()
The sub-nodes of this explanation node.private java.lang.String
getSummary()
java.lang.Number
getValue()
The value assigned to this explanation node.int
hashCode()
boolean
isMatch()
Indicates whether or not this Explanation models a match.static Explanation
match(java.lang.Number value, java.lang.String description, java.util.Collection<Explanation> details)
Create a new explanation for a match.static Explanation
match(java.lang.Number value, java.lang.String description, Explanation... details)
Create a new explanation for a match.static Explanation
noMatch(java.lang.String description, java.util.Collection<Explanation> details)
Create a new explanation for a document which does not match.static Explanation
noMatch(java.lang.String description, Explanation... details)
Create a new explanation for a document which does not match.java.lang.String
toString()
Render an explanation as text.private java.lang.String
toString(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
- howvalue
was 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
- howvalue
was 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:
toString
in classjava.lang.Object
-
toString
private java.lang.String toString(int depth)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-