com.sangupta.esclient.domain.IndexSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of esclient Show documentation
Show all versions of esclient Show documentation
Strongly-typed SDK for ElasticSearch
The newest version!
package com.sangupta.esclient.domain;
import com.sangupta.esclient.domain.analysis.CustomAnalyzer;
import com.sangupta.esclient.domain.analysis.AnalyzerFilter;
import com.sangupta.esclient.domain.analysis.CharFilter;
public class IndexSettings {
private int numberOfShards = 1;
private int numberOfReplicas = 1;
private AnalysisSettings analysis;
public void addAnalyzer(String name, CustomAnalyzer analyzer) {
if(this.analysis == null) {
this.analysis = new AnalysisSettings();
}
this.analysis.addAnalyzer(name, analyzer);
}
public void addCharFilter(String name, CharFilter charFilter) {
if(this.analysis == null) {
this.analysis = new AnalysisSettings();
}
this.analysis.addCharFilter(name, charFilter);
}
public void addAnalyzerFilter(String name, AnalyzerFilter filter) {
if(this.analysis == null) {
this.analysis = new AnalysisSettings();
}
this.analysis.addAnalyzerFilter(name, filter);
}
// Usual accessors follow
/**
* @return the numberOfShards
*/
public int getNumberOfShards() {
return numberOfShards;
}
/**
* @param numberOfShards the numberOfShards to set
*/
public void setNumberOfShards(int numberOfShards) {
this.numberOfShards = numberOfShards;
}
/**
* @return the numberOfReplicas
*/
public int getNumberOfReplicas() {
return numberOfReplicas;
}
/**
* @param numberOfReplicas the numberOfReplicas to set
*/
public void setNumberOfReplicas(int numberOfReplicas) {
this.numberOfReplicas = numberOfReplicas;
}
}