Class SearchIndex
- java.lang.Object
-
- com.azure.search.documents.indexes.models.SearchIndex
-
public final class SearchIndex extends Object
Represents a search index definition, which describes the fields and search behavior of an index.
-
-
Constructor Summary
Constructors Constructor Description SearchIndex(String name)
Constructor ofSearchIndex
.SearchIndex(String name, List<SearchField> fields)
Constructor ofSearchIndex
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LexicalAnalyzer>
getAnalyzers()
Get the analyzers property: The analyzers for the index.List<CharFilter>
getCharFilters()
Get the charFilters property: The character filters for the index.CorsOptions
getCorsOptions()
Get the corsOptions property: Options to control Cross-Origin Resource Sharing (CORS) for the index.String
getDefaultScoringProfile()
Get the defaultScoringProfile property: The name of the scoring profile to use if none is specified in the query.SearchResourceEncryptionKey
getEncryptionKey()
Get the encryptionKey property: A description of an encryption key that you create in Azure Key Vault.String
getETag()
Get the eTag property: The ETag of the index.List<SearchField>
getFields()
Get the fields property: The fields of the index.String
getName()
Get the name property: The name of the index.List<LexicalNormalizer>
getNormalizers()
Get the normalizers property: The normalizers for the index.List<ScoringProfile>
getScoringProfiles()
Get the scoringProfiles property: The scoring profiles for the index.SimilarityAlgorithm
getSimilarity()
Get the similarity property: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query.List<SearchSuggester>
getSuggesters()
Get the suggesters property: The suggesters for the index.List<TokenFilter>
getTokenFilters()
Get the tokenFilters property: The token filters for the index.List<LexicalTokenizer>
getTokenizers()
Get the tokenizers property: The tokenizers for the index.SearchIndex
setAnalyzers(LexicalAnalyzer... analyzers)
Set the analyzers property: The analyzers for the index.SearchIndex
setAnalyzers(List<LexicalAnalyzer> analyzers)
Set the analyzers property: The analyzers for the index.SearchIndex
setCharFilters(CharFilter... charFilters)
Set the charFilters property: The character filters for the index.SearchIndex
setCharFilters(List<CharFilter> charFilters)
Set the charFilters property: The character filters for the index.SearchIndex
setCorsOptions(CorsOptions corsOptions)
Set the corsOptions property: Options to control Cross-Origin Resource Sharing (CORS) for the index.SearchIndex
setDefaultScoringProfile(String defaultScoringProfile)
Set the defaultScoringProfile property: The name of the scoring profile to use if none is specified in the query.SearchIndex
setEncryptionKey(SearchResourceEncryptionKey encryptionKey)
Set the encryptionKey property: A description of an encryption key that you create in Azure Key Vault.SearchIndex
setETag(String eTag)
Set the eTag property: The ETag of the index.SearchIndex
setFields(SearchField... fields)
Set the fields property: The fields of the index.SearchIndex
setFields(List<SearchField> fields)
Set the fields property: The fields of the index.SearchIndex
setNormalizers(LexicalNormalizer... normalizers)
Set the normalizers property: The normalizers for the index.SearchIndex
setNormalizers(List<LexicalNormalizer> normalizers)
Set the normalizers property: The normalizers for the index.SearchIndex
setScoringProfiles(ScoringProfile... scoringProfiles)
Set the scoringProfiles property: The scoring profiles for the index.SearchIndex
setScoringProfiles(List<ScoringProfile> scoringProfiles)
Set the scoringProfiles property: The scoring profiles for the index.SearchIndex
setSimilarity(SimilarityAlgorithm similarity)
Set the similarity property: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query.SearchIndex
setSuggesters(SearchSuggester... suggesters)
Set the suggesters property: The suggesters for the index.SearchIndex
setSuggesters(List<SearchSuggester> suggesters)
Set the suggesters property: The suggesters for the index.SearchIndex
setTokenFilters(TokenFilter... tokenFilters)
Set the tokenFilters property: The token filters for the index.SearchIndex
setTokenFilters(List<TokenFilter> tokenFilters)
Set the tokenFilters property: The token filters for the index.SearchIndex
setTokenizers(LexicalTokenizer... tokenizers)
Set the tokenizers property: The tokenizers for the index.SearchIndex
setTokenizers(List<LexicalTokenizer> tokenizers)
Set the tokenizers property: The tokenizers for the index.
-
-
-
Constructor Detail
-
SearchIndex
public SearchIndex(String name)
Constructor ofSearchIndex
.- Parameters:
name
- The name of the index.
-
SearchIndex
public SearchIndex(String name, List<SearchField> fields)
Constructor ofSearchIndex
.- Parameters:
name
- The name of the index.fields
- The fields of the index.
-
-
Method Detail
-
getName
public String getName()
Get the name property: The name of the index.- Returns:
- the name value.
-
getFields
public List<SearchField> getFields()
Get the fields property: The fields of the index.- Returns:
- the fields value.
-
setFields
public SearchIndex setFields(SearchField... fields)
Set the fields property: The fields of the index.- Parameters:
fields
- the fields value to set.- Returns:
- the SearchIndex object itself.
-
setFields
public SearchIndex setFields(List<SearchField> fields)
Set the fields property: The fields of the index.- Parameters:
fields
- the fields value to set.- Returns:
- the SearchIndex object itself.
-
getScoringProfiles
public List<ScoringProfile> getScoringProfiles()
Get the scoringProfiles property: The scoring profiles for the index.- Returns:
- the scoringProfiles value.
-
setScoringProfiles
public SearchIndex setScoringProfiles(ScoringProfile... scoringProfiles)
Set the scoringProfiles property: The scoring profiles for the index.- Parameters:
scoringProfiles
- the scoringProfiles value to set.- Returns:
- the SearchIndex object itself.
-
setScoringProfiles
public SearchIndex setScoringProfiles(List<ScoringProfile> scoringProfiles)
Set the scoringProfiles property: The scoring profiles for the index.- Parameters:
scoringProfiles
- the scoringProfiles value to set.- Returns:
- the SearchIndex object itself.
-
getDefaultScoringProfile
public String getDefaultScoringProfile()
Get the defaultScoringProfile property: The name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used.- Returns:
- the defaultScoringProfile value.
-
setDefaultScoringProfile
public SearchIndex setDefaultScoringProfile(String defaultScoringProfile)
Set the defaultScoringProfile property: The name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used.- Parameters:
defaultScoringProfile
- the defaultScoringProfile value to set.- Returns:
- the SearchIndex object itself.
-
getCorsOptions
public CorsOptions getCorsOptions()
Get the corsOptions property: Options to control Cross-Origin Resource Sharing (CORS) for the index.- Returns:
- the corsOptions value.
-
setCorsOptions
public SearchIndex setCorsOptions(CorsOptions corsOptions)
Set the corsOptions property: Options to control Cross-Origin Resource Sharing (CORS) for the index.- Parameters:
corsOptions
- the corsOptions value to set.- Returns:
- the SearchIndex object itself.
-
getSuggesters
public List<SearchSuggester> getSuggesters()
Get the suggesters property: The suggesters for the index.- Returns:
- the suggesters value.
-
setSuggesters
public SearchIndex setSuggesters(SearchSuggester... suggesters)
Set the suggesters property: The suggesters for the index.- Parameters:
suggesters
- the suggesters value to set.- Returns:
- the SearchIndex object itself.
-
setSuggesters
public SearchIndex setSuggesters(List<SearchSuggester> suggesters)
Set the suggesters property: The suggesters for the index.- Parameters:
suggesters
- the suggesters value to set.- Returns:
- the SearchIndex object itself.
-
getAnalyzers
public List<LexicalAnalyzer> getAnalyzers()
Get the analyzers property: The analyzers for the index.- Returns:
- the analyzers value.
-
setAnalyzers
public SearchIndex setAnalyzers(LexicalAnalyzer... analyzers)
Set the analyzers property: The analyzers for the index.- Parameters:
analyzers
- the analyzers value to set.- Returns:
- the SearchIndex object itself.
-
setAnalyzers
public SearchIndex setAnalyzers(List<LexicalAnalyzer> analyzers)
Set the analyzers property: The analyzers for the index.- Parameters:
analyzers
- the analyzers value to set.- Returns:
- the SearchIndex object itself.
-
getTokenizers
public List<LexicalTokenizer> getTokenizers()
Get the tokenizers property: The tokenizers for the index.- Returns:
- the tokenizers value.
-
setTokenizers
public SearchIndex setTokenizers(LexicalTokenizer... tokenizers)
Set the tokenizers property: The tokenizers for the index.- Parameters:
tokenizers
- the tokenizers value to set.- Returns:
- the SearchIndex object itself.
-
setTokenizers
public SearchIndex setTokenizers(List<LexicalTokenizer> tokenizers)
Set the tokenizers property: The tokenizers for the index.- Parameters:
tokenizers
- the tokenizers value to set.- Returns:
- the SearchIndex object itself.
-
getTokenFilters
public List<TokenFilter> getTokenFilters()
Get the tokenFilters property: The token filters for the index.- Returns:
- the tokenFilters value.
-
setTokenFilters
public SearchIndex setTokenFilters(TokenFilter... tokenFilters)
Set the tokenFilters property: The token filters for the index.- Parameters:
tokenFilters
- the tokenFilters value to set.- Returns:
- the SearchIndex object itself.
-
setTokenFilters
public SearchIndex setTokenFilters(List<TokenFilter> tokenFilters)
Set the tokenFilters property: The token filters for the index.- Parameters:
tokenFilters
- the tokenFilters value to set.- Returns:
- the SearchIndex object itself.
-
getCharFilters
public List<CharFilter> getCharFilters()
Get the charFilters property: The character filters for the index.- Returns:
- the charFilters value.
-
setCharFilters
public SearchIndex setCharFilters(CharFilter... charFilters)
Set the charFilters property: The character filters for the index.- Parameters:
charFilters
- the charFilters value to set.- Returns:
- the SearchIndex object itself.
-
setCharFilters
public SearchIndex setCharFilters(List<CharFilter> charFilters)
Set the charFilters property: The character filters for the index.- Parameters:
charFilters
- the charFilters value to set.- Returns:
- the SearchIndex object itself.
-
getNormalizers
public List<LexicalNormalizer> getNormalizers()
Get the normalizers property: The normalizers for the index.- Returns:
- the normalizers value.
-
setNormalizers
public SearchIndex setNormalizers(LexicalNormalizer... normalizers)
Set the normalizers property: The normalizers for the index.- Parameters:
normalizers
- the normalizers value to set.- Returns:
- the SearchIndex object itself.
-
setNormalizers
public SearchIndex setNormalizers(List<LexicalNormalizer> normalizers)
Set the normalizers property: The normalizers for the index.- Parameters:
normalizers
- the normalizers value to set.- Returns:
- the SearchIndex object itself.
-
getEncryptionKey
public SearchResourceEncryptionKey getEncryptionKey()
Get the encryptionKey property: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019.- Returns:
- the encryptionKey value.
-
setEncryptionKey
public SearchIndex setEncryptionKey(SearchResourceEncryptionKey encryptionKey)
Set the encryptionKey property: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019.- Parameters:
encryptionKey
- the encryptionKey value to set.- Returns:
- the SearchIndex object itself.
-
getSimilarity
public SimilarityAlgorithm getSimilarity()
Get the similarity property: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used.- Returns:
- the similarity value.
-
setSimilarity
public SearchIndex setSimilarity(SimilarityAlgorithm similarity)
Set the similarity property: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used.- Parameters:
similarity
- the similarity value to set.- Returns:
- the SearchIndex object itself.
-
getETag
public String getETag()
Get the eTag property: The ETag of the index.- Returns:
- the eTag value.
-
setETag
public SearchIndex setETag(String eTag)
Set the eTag property: The ETag of the index.- Parameters:
eTag
- the eTag value to set.- Returns:
- the SearchIndex object itself.
-
-