Class QueryCaptionResult

java.lang.Object
com.azure.search.documents.models.QueryCaptionResult
All Implemented Interfaces:
com.azure.json.JsonSerializable<QueryCaptionResult>

public final class QueryCaptionResult extends Object implements com.azure.json.JsonSerializable<QueryCaptionResult>
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`.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of QueryCaptionResult class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of QueryCaptionResult from the JsonReader.
    Get the additionalProperties property: Captions are the most representative passages from the document relatively to the search query.
    Get the highlights property: Same text passage as in the Text property with highlighted phrases most relevant to the query.
    Get the text property: A representative text passage extracted from the document most relevant to the search query.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • QueryCaptionResult

      public QueryCaptionResult()
      Creates an instance of QueryCaptionResult class.
  • Method Details

    • getText

      public String getText()
      Get the text property: A representative text passage extracted from the document most relevant to the search query.
      Returns:
      the text value.
    • getHighlights

      public String getHighlights()
      Get the highlights property: Same text passage as in the Text property with highlighted phrases most relevant to the query.
      Returns:
      the highlights value.
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Get the additionalProperties 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 additionalProperties value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<QueryCaptionResult>
      Throws:
      IOException
    • fromJson

      public static QueryCaptionResult fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of QueryCaptionResult from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of QueryCaptionResult if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the QueryCaptionResult.