org.apache.lucene.search

## Class Explanation

- java.lang.Object
- - org.apache.lucene.search.Explanation

-     public final class Explanation
      extends Object

  Expert: Describes the score computation for document and query.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getDescription()` A description of this explanation node.
    `Explanation[]` | `getDetails()` The sub-nodes of this explanation node.
    `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(Number value, String description, Collection<Explanation> details)` Create a new explanation for a match.
    `static Explanation` | `match(Number value, String description, Explanation... details)` Create a new explanation for a match.
    `static Explanation` | `noMatch(String description, Collection<Explanation> details)` Create a new explanation for a document which does not match.
    `static Explanation` | `noMatch(String description, Explanation... details)` Create a new explanation for a document which does not match.
    `String` | `toString()` Render an explanation as text.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### match

          public static Explanation match(Number value,
                                          String description,
                                          Collection<Explanation> details)

      Create a new explanation for a match.
      Parameters:
        `value` - the contribution to the score of the document
        `description` - how `value` was computed
        `details` - sub explanations that contributed to this explanation

    - #### match

          public static Explanation match(Number value,
                                          String description,
                                          Explanation... details)

      Create a new explanation for a match.
      Parameters:
        `value` - the contribution to the score of the document
        `description` - how `value` was computed
        `details` - sub explanations that contributed to this explanation

    - #### noMatch

          public static Explanation noMatch(String description,
                                            Collection<Explanation> details)

      Create a new explanation for a document which does not match.

    - #### noMatch

          public static Explanation noMatch(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 Number getValue()

      The value assigned to this explanation node.

    - #### getDescription

          public String getDescription()

      A description of this explanation node.

    - #### getDetails

          public Explanation[] getDetails()

      The sub-nodes of this explanation node.

    - #### toString

          public String toString()

      Render an explanation as text.
      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.