Class SemanticPrioritizedFields

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

public final class SemanticPrioritizedFields extends Object implements com.azure.json.JsonSerializable<SemanticPrioritizedFields>
Describes the title, content, and keywords fields to be used for semantic ranking, captions, highlights, and answers.
  • Constructor Details

    • SemanticPrioritizedFields

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

    • getTitleField

      public SemanticField getTitleField()
      Get the titleField property: Defines the title field to be used for semantic ranking, captions, highlights, and answers. If you don't have a title field in your index, leave this blank.
      Returns:
      the titleField value.
    • setTitleField

      public SemanticPrioritizedFields setTitleField(SemanticField titleField)
      Set the titleField property: Defines the title field to be used for semantic ranking, captions, highlights, and answers. If you don't have a title field in your index, leave this blank.
      Parameters:
      titleField - the titleField value to set.
      Returns:
      the SemanticPrioritizedFields object itself.
    • getContentFields

      public List<SemanticField> getContentFields()
      Get the contentFields property: Defines the content fields to be used for semantic ranking, captions, highlights, and answers. For the best result, the selected fields should contain text in natural language form. The order of the fields in the array represents their priority. Fields with lower priority may get truncated if the content is long.
      Returns:
      the contentFields value.
    • setContentFields

      public SemanticPrioritizedFields setContentFields(List<SemanticField> contentFields)
      Set the contentFields property: Defines the content fields to be used for semantic ranking, captions, highlights, and answers. For the best result, the selected fields should contain text in natural language form. The order of the fields in the array represents their priority. Fields with lower priority may get truncated if the content is long.
      Parameters:
      contentFields - the contentFields value to set.
      Returns:
      the SemanticPrioritizedFields object itself.
    • getKeywordsFields

      public List<SemanticField> getKeywordsFields()
      Get the keywordsFields property: Defines the keyword fields to be used for semantic ranking, captions, highlights, and answers. For the best result, the selected fields should contain a list of keywords. The order of the fields in the array represents their priority. Fields with lower priority may get truncated if the content is long.
      Returns:
      the keywordsFields value.
    • setKeywordsFields

      public SemanticPrioritizedFields setKeywordsFields(List<SemanticField> keywordsFields)
      Set the keywordsFields property: Defines the keyword fields to be used for semantic ranking, captions, highlights, and answers. For the best result, the selected fields should contain a list of keywords. The order of the fields in the array represents their priority. Fields with lower priority may get truncated if the content is long.
      Parameters:
      keywordsFields - the keywordsFields value to set.
      Returns:
      the SemanticPrioritizedFields object itself.
    • toJson

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

      public static SemanticPrioritizedFields fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SemanticPrioritizedFields from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SemanticPrioritizedFields 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 SemanticPrioritizedFields.
    • setContentFields

      public SemanticPrioritizedFields setContentFields(SemanticField... contentFields)
      Set the contentFields property: Defines the content fields to be used for semantic ranking, captions, highlights, and answers. For the best result, the selected fields should contain text in natural language form. The order of the fields in the array represents their priority. Fields with lower priority may get truncated if the content is long.
      Parameters:
      contentFields - the contentFields value to set.
      Returns:
      the SemanticPrioritizedFields object itself.
    • setKeywordsFields

      public SemanticPrioritizedFields setKeywordsFields(SemanticField... keywordsFields)
      Set the keywordsFields property: Defines the keyword fields to be used for semantic ranking, captions, highlights, and answers. For the best result, the selected fields should contain a list of keywords. The order of the fields in the array represents their priority. Fields with lower priority may get truncated if the content is long.
      Parameters:
      keywordsFields - the keywordsFields value to set.
      Returns:
      the SemanticPrioritizedFields object itself.