TextWeights.java

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. //
  4. // Code generated by Microsoft (R) AutoRest Code Generator.
  5. // Changes may cause incorrect behavior and will be lost if the code is
  6. // regenerated.

  7. package com.azure.search.documents.indexes.models;

  8. import com.azure.core.annotation.Fluent;
  9. import com.fasterxml.jackson.annotation.JsonCreator;
  10. import com.fasterxml.jackson.annotation.JsonProperty;
  11. import java.util.Map;

  12. /** Defines weights on index fields for which matches should boost scoring in search queries. */
  13. @Fluent
  14. public final class TextWeights {
  15.     /*
  16.      * The dictionary of per-field weights to boost document scoring. The keys
  17.      * are field names and the values are the weights for each field.
  18.      */
  19.     @JsonProperty(value = "weights", required = true)
  20.     private Map<String, Double> weights;

  21.     /**
  22.      * Creates an instance of TextWeights class.
  23.      *
  24.      * @param weights the weights value to set.
  25.      */
  26.     @JsonCreator
  27.     public TextWeights(@JsonProperty(value = "weights", required = true) Map<String, Double> weights) {
  28.         this.weights = weights;
  29.     }

  30.     /**
  31.      * Get the weights property: The dictionary of per-field weights to boost document scoring. The keys are field names
  32.      * and the values are the weights for each field.
  33.      *
  34.      * @return the weights value.
  35.      */
  36.     public Map<String, Double> getWeights() {
  37.         return this.weights;
  38.     }
  39. }