Class SearchResult
- java.lang.Object
-
- com.azure.search.documents.models.SearchResult
-
public final class SearchResult extends Object
Contains a document found by a search query, plus associated metadata.
-
-
Constructor Summary
Constructors Constructor Description SearchResult(double score)
Constructor ofSearchResult
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CaptionResult>
getCaptions()
Get 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.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.Double
getRerankerScore()
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 Detail
-
SearchResult
public SearchResult(double score)
Constructor ofSearchResult
.- 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.
-
-