Class SearchResult


  • public final class SearchResult
    extends Object
    Contains a document found by a search query, plus associated metadata.
    • Constructor Detail

      • SearchResult

        public SearchResult​(double score)
        Constructor of SearchResult.
        Parameters:
        score - The relevance score of the document compared to other documents returned by the query.
    • Method Detail

      • getScore

        public double getScore()
        Get the score property: The relevance score of the document compared to other documents returned by the query.
        Returns:
        the score value.
      • getRerankerScore

        public Double getRerankerScore()
        Get the rerankerScore property: The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'.
        Returns:
        the rerankerScore value.
      • getHighlights

        public Map<String,​List<String>> getHighlights()
        Get the highlights property: Text fragments from the document that indicate the matching search terms, organized by each applicable field; null if hit highlighting was not enabled for the query.
        Returns:
        the highlights value.
      • getCaptions

        public List<CaptionResult> getCaptions()
        Get the captions property: Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'.
        Returns:
        the captions value.
      • getDocument

        public <T> T getDocument​(Class<T> modelClass)
        Get the additionalProperties property: Unmatched properties from the message are deserialized this collection.
        Type Parameters:
        T - Convert document to the generic type.
        Parameters:
        modelClass - The model class converts to.
        Returns:
        the additionalProperties value.
        Throws:
        RuntimeException - if there is IO error occurs.