LuceneStandardAnalyzer.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 com.fasterxml.jackson.annotation.JsonSetter;
  12. import com.fasterxml.jackson.annotation.JsonTypeId;
  13. import com.fasterxml.jackson.annotation.JsonTypeInfo;
  14. import com.fasterxml.jackson.annotation.JsonTypeName;
  15. import java.util.List;

  16. /** Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop filter. */
  17. @JsonTypeInfo(
  18.         use = JsonTypeInfo.Id.NAME,
  19.         include = JsonTypeInfo.As.EXISTING_PROPERTY,
  20.         property = "@odata.type",
  21.         visible = true)
  22. @JsonTypeName("#Microsoft.Azure.Search.StandardAnalyzer")
  23. @Fluent
  24. public final class LuceneStandardAnalyzer extends LexicalAnalyzer {

  25.     /*
  26.      * Identifies the concrete type of the analyzer.
  27.      */
  28.     @JsonTypeId
  29.     @JsonProperty(value = "@odata.type", required = true)
  30.     private String odataType = "#Microsoft.Azure.Search.StandardAnalyzer";

  31.     /*
  32.      * The maximum token length. Default is 255. Tokens longer than the maximum
  33.      * length are split. The maximum token length that can be used is 300
  34.      * characters.
  35.      */
  36.     @JsonProperty(value = "maxTokenLength")
  37.     private Integer maxTokenLength;

  38.     /*
  39.      * A list of stopwords.
  40.      */
  41.     @JsonProperty(value = "stopwords")
  42.     private List<String> stopwords;

  43.     /**
  44.      * Creates an instance of LuceneStandardAnalyzer class.
  45.      *
  46.      * @param name the name value to set.
  47.      */
  48.     @JsonCreator
  49.     public LuceneStandardAnalyzer(@JsonProperty(value = "name", required = true) String name) {
  50.         super(name);
  51.     }

  52.     /**
  53.      * Get the maxTokenLength property: The maximum token length. Default is 255. Tokens longer than the maximum length
  54.      * are split. The maximum token length that can be used is 300 characters.
  55.      *
  56.      * @return the maxTokenLength value.
  57.      */
  58.     public Integer getMaxTokenLength() {
  59.         return this.maxTokenLength;
  60.     }

  61.     /**
  62.      * Set the maxTokenLength property: The maximum token length. Default is 255. Tokens longer than the maximum length
  63.      * are split. The maximum token length that can be used is 300 characters.
  64.      *
  65.      * @param maxTokenLength the maxTokenLength value to set.
  66.      * @return the LuceneStandardAnalyzer object itself.
  67.      */
  68.     public LuceneStandardAnalyzer setMaxTokenLength(Integer maxTokenLength) {
  69.         this.maxTokenLength = maxTokenLength;
  70.         return this;
  71.     }

  72.     /**
  73.      * Get the stopwords property: A list of stopwords.
  74.      *
  75.      * @return the stopwords value.
  76.      */
  77.     public List<String> getStopwords() {
  78.         return this.stopwords;
  79.     }

  80.     /**
  81.      * Set the stopwords property: A list of stopwords.
  82.      *
  83.      * @param stopwords the stopwords value to set.
  84.      * @return the LuceneStandardAnalyzer object itself.
  85.      */
  86.     @JsonSetter
  87.     public LuceneStandardAnalyzer setStopwords(List<String> stopwords) {
  88.         this.stopwords = stopwords;
  89.         return this;
  90.     }

  91.     /**
  92.      * Set the stopwords property: A list of stopwords.
  93.      *
  94.      * @param stopwords the stopwords value to set.
  95.      * @return the LuceneStandardAnalyzer object itself.
  96.      */
  97.     public LuceneStandardAnalyzer setStopwords(String... stopwords) {
  98.         this.stopwords = (stopwords == null) ? null : java.util.Arrays.asList(stopwords);
  99.         return this;
  100.     }
  101. }