org.apache.lucene.search.suggest.document

## Class TopSuggestDocs.SuggestScoreDoc

- java.lang.Object
- - org.apache.lucene.search.ScoreDoc
  - - org.apache.lucene.search.suggest.document.TopSuggestDocs.SuggestScoreDoc

- All Implemented Interfaces:
    Comparable<TopSuggestDocs.SuggestScoreDoc>
  Enclosing class:
    TopSuggestDocs

      public static class TopSuggestDocs.SuggestScoreDoc
      extends ScoreDoc
      implements Comparable<TopSuggestDocs.SuggestScoreDoc>

  `ScoreDoc` with an additional CharSequence key

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `CharSequence` | `context` Context for the completion
    `CharSequence` | `key` Matched completion key

    - ### Fields inherited from class org.apache.lucene.search.ScoreDoc

      `doc, score, shardIndex`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SuggestScoreDoc(int doc, CharSequence key, CharSequence context, float score)` Creates a SuggestScoreDoc instance

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(TopSuggestDocs.SuggestScoreDoc o)`
    `boolean` | `equals(Object other)`
    `int` | `hashCode()`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### key

          public final CharSequence key

      Matched completion key

    - #### context

          public final CharSequence context

      Context for the completion

  - ### Constructor Detail

    - #### SuggestScoreDoc

          public SuggestScoreDoc(int doc,
                                 CharSequence key,
                                 CharSequence context,
                                 float score)

      Creates a SuggestScoreDoc instance
      Parameters:
        `doc` - document id (hit)
        `key` - matched completion
        `score` - weight of the matched completion

  - ### Method Detail

    - #### compareTo

          public int compareTo(TopSuggestDocs.SuggestScoreDoc o)

      Specified by:
        `compareTo` in interface `Comparable<TopSuggestDocs.SuggestScoreDoc>`

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `ScoreDoc`

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