SearchSuggester.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.List;

  12. /** Defines how the Suggest API should apply to a group of fields in the index. */
  13. @Fluent
  14. public final class SearchSuggester {
  15.     /*
  16.      * The name of the suggester.
  17.      */
  18.     @JsonProperty(value = "name", required = true)
  19.     private String name;

  20.     /*
  21.      * A value indicating the capabilities of the suggester.
  22.      */
  23.     @JsonProperty(value = "searchMode")
  24.     private String searchMode = "analyzingInfixMatching";

  25.     /*
  26.      * The list of field names to which the suggester applies. Each field must
  27.      * be searchable.
  28.      */
  29.     @JsonProperty(value = "sourceFields", required = true)
  30.     private List<String> sourceFields;

  31.     /**
  32.      * Creates an instance of SearchSuggester class.
  33.      *
  34.      * @param name the name value to set.
  35.      * @param sourceFields the sourceFields value to set.
  36.      */
  37.     @JsonCreator
  38.     public SearchSuggester(
  39.             @JsonProperty(value = "name", required = true) String name,
  40.             @JsonProperty(value = "sourceFields", required = true) List<String> sourceFields) {
  41.         this.searchMode = "analyzingInfixMatching";
  42.         this.name = name;
  43.         this.sourceFields = sourceFields;
  44.     }

  45.     /**
  46.      * Get the name property: The name of the suggester.
  47.      *
  48.      * @return the name value.
  49.      */
  50.     public String getName() {
  51.         return this.name;
  52.     }

  53.     /**
  54.      * Get the searchMode property: A value indicating the capabilities of the suggester.
  55.      *
  56.      * @return the searchMode value.
  57.      */
  58.     public String getSearchMode() {
  59.         return this.searchMode;
  60.     }

  61.     /**
  62.      * Get the sourceFields property: The list of field names to which the suggester applies. Each field must be
  63.      * searchable.
  64.      *
  65.      * @return the sourceFields value.
  66.      */
  67.     public List<String> getSourceFields() {
  68.         return this.sourceFields;
  69.     }
  70. }