org.apache.lucene.search

## Class Explanation

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

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    ComplexExplanation

      public class Explanation
      extends java.lang.Object
      implements java.io.Serializable

  Expert: Describes the score computation for document and query.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Explanation.IDFExplanation` Small Util class used to pass both an idf factor as well as an explanation for that factor.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Explanation()`
    `Explanation(float value, java.lang.String description)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDetail(Explanation detail)` Adds a sub-node to this explanation node.
    `java.lang.String` | `getDescription()` A description of this explanation node.
    `Explanation[]` | `getDetails()` The sub-nodes of this explanation node.
    `protected java.lang.String` | `getSummary()` A short one line summary which should contain all high level information about this Explanation, without the "Details"
    `float` | `getValue()` The value assigned to this explanation node.
    `boolean` | `isMatch()` Indicates whether or not this Explanation models a good match.
    `void` | `setDescription(java.lang.String description)` Sets the description of this explanation node.
    `void` | `setValue(float value)` Sets the value assigned to this explanation node.
    `java.lang.String` | `toHtml()` Render an explanation as HTML.
    `java.lang.String` | `toString()` Render an explanation as text.
    `protected java.lang.String` | `toString(int depth)`

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

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

- - ### Constructor Detail

    - #### Explanation

          public Explanation()

    - #### Explanation

          public Explanation(float value,
                             java.lang.String description)

  - ### Method Detail

    - #### isMatch

          public boolean isMatch()

      Indicates whether or not this Explanation models a good match.

      By default, an Explanation represents a "match" if the value is positive.

      See Also:
        `getValue()`

    - #### getValue

          public float getValue()

      The value assigned to this explanation node.

    - #### setValue

          public void setValue(float value)

      Sets the value assigned to this explanation node.

    - #### getDescription

          public java.lang.String getDescription()

      A description of this explanation node.

    - #### setDescription

          public void setDescription(java.lang.String description)

      Sets the description of this explanation node.

    - #### getSummary

          protected java.lang.String getSummary()

      A short one line summary which should contain all high level information about this Explanation, without the "Details"

    - #### getDetails

          public Explanation[] getDetails()

      The sub-nodes of this explanation node.

    - #### addDetail

          public void addDetail(Explanation detail)

      Adds a sub-node to this explanation node.

    - #### toString

          public java.lang.String toString()

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

    - #### toString

          protected java.lang.String toString(int depth)

    - #### toHtml

          public java.lang.String toHtml()

      Render an explanation as HTML.

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