Class OpenSearchSearchResult

java.lang.Object
com.atlassian.confluence.search.v2.AbstractSearchResult
com.atlassian.confluence.plugins.opensearch.OpenSearchSearchResult
All Implemented Interfaces:
BaseSearchResult, SearchResult

public class OpenSearchSearchResult extends AbstractSearchResult
An individual search result from OpenSearch hit
Since:
8.6
  • Constructor Details

    • OpenSearchSearchResult

      public OpenSearchSearchResult(org.opensearch.client.opensearch.core.search.Hit<?> hit, Encoder encoder)
  • Method Details

    • getHandleId

      public long getHandleId()
      Description copied from interface: BaseSearchResult
      Get the handle ID
      Returns:
      the ID of the Handle object
    • getFieldNames

      public Set<String> getFieldNames()
      Description copied from interface: BaseSearchResult
      Return names of all fields of a given document.
      Specified by:
      getFieldNames in interface BaseSearchResult
      Specified by:
      getFieldNames in class AbstractSearchResult
      Returns:
      names of all known fields or null
    • getFieldValue

      public String getFieldValue(String fieldName)
      Description copied from class: AbstractSearchResult
      Return a string value of a field of a given document, if the field has multiple values then return last value, if there is no such field then return null.
      Specified by:
      getFieldValue in class AbstractSearchResult
      Returns:
      a string value of a field
    • getFieldValues

      public Set<String> getFieldValues(String fieldName)
      Description copied from class: AbstractSearchResult
      Return set of string values of a field of a given document, if the field has single value then return singleton set of that value, if there is no such field then return empty set.
      Specified by:
      getFieldValues in interface BaseSearchResult
      Specified by:
      getFieldValues in class AbstractSearchResult
      Returns:
      a string value of a field
    • getDisplayTitleWithHighlights

      public String getDisplayTitleWithHighlights()
      Description copied from interface: SearchResult
      Gets the title of the search result appropriate for displaying to a user with matches highlighted. All results should return something useful for this method.
      Returns:
      the title of the search result appropriate for display on a page with matches highlighted
    • getResultExcerptWithHighlights

      public String getResultExcerptWithHighlights()
      Description copied from interface: SearchResult
      Gets excerpt from the context of the search result, as SearchResult.getResultExcerpt(), but in a HTML-safe manner. Implementations should highlight hits with SearchResult.HIGHLIGHT_START and SearchResult.HIGHLIGHT_END. The default implementation simply HTML-encode the result of SearchResult.getResultExcerpt().
      Returns:
      excerpt of the content of the search result with matches highlighted
    • getScore

      public Double getScore()