SearchResult Class

  • java.lang.Object
    • com.azure.search.documents.models.SearchResult

Implements

public final class SearchResult
implements JsonSerializable<SearchResult>

Contains a document found by a search query, plus associated metadata.

Constructor Summary

Constructor Description
SearchResult()

Creates an instance of SearchResult class.

Method Summary

Modifier and Type Method and Description
static SearchResult fromJson(JsonReader jsonReader)

Reads an instance of SearchResult from the JsonReader.

Map<String,Object> getAdditionalProperties()

Get the additionalProperties property: Contains a document found by a search query, plus associated metadata.

List<QueryCaptionResult> getCaptions()

Get the captions property: Captions are the most representative passages from the document relatively to the search query.

DocumentDebugInfo getDocumentDebugInfo()

Get the documentDebugInfo property: Contains debugging information that can be used to further explore your search results.

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 getRerankerBoostedScore()

Get the rerankerBoostedScore property: The relevance score computed by boosting the Reranker Score.

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.

SearchResult setAdditionalProperties(Map<String,Object> additionalProperties)

Set the additionalProperties property: Contains a document found by a search query, plus associated metadata.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

SearchResult

public SearchResult()

Creates an instance of SearchResult class.

Method Details

fromJson

public static SearchResult fromJson(JsonReader jsonReader)

Reads an instance of SearchResult from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of SearchResult if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getAdditionalProperties

public Map<String,Object> getAdditionalProperties()

Get the additionalProperties property: Contains a document found by a search query, plus associated metadata.

Returns:

the additionalProperties value.

getCaptions

public List<QueryCaptionResult> 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.

getDocumentDebugInfo

public DocumentDebugInfo getDocumentDebugInfo()

Get the documentDebugInfo property: Contains debugging information that can be used to further explore your search results.

Returns:

the documentDebugInfo 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.

getRerankerBoostedScore

public Double getRerankerBoostedScore()

Get the rerankerBoostedScore property: The relevance score computed by boosting the Reranker Score. Search results are sorted by the RerankerScore/RerankerBoostedScore based on useScoringProfileBoostedRanking in the Semantic Config. RerankerBoostedScore is only returned for queries of type 'semantic'.

Returns:

the rerankerBoostedScore 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.

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.

setAdditionalProperties

public SearchResult setAdditionalProperties(Map<String,Object> additionalProperties)

Set the additionalProperties property: Contains a document found by a search query, plus associated metadata.

Parameters:

additionalProperties - the additionalProperties value to set.

Returns:

the SearchResult object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to