Class SearchResult
java.lang.Object
com.azure.search.documents.models.SearchResult
Contains a document found by a search query, plus associated metadata.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the captions property: Captions are the most representative passages from the document relatively to the search query.<T> T
getDocument
(Class<T> modelClass) Get the additionalProperties property: Unmatched properties from the message are deserialized this collection.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.Get the rerankerScore property: The relevance score computed by the semantic ranker for the top search results.double
getScore()
Get the score property: The relevance score of the document compared to other documents returned by the query.
-
Constructor Details
-
SearchResult
public SearchResult(double score) Constructor ofSearchResult
.- Parameters:
score
- The relevance score of the document compared to other documents returned by the query.
-
-
Method Details
-
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
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
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
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
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.
-