com.github.wz2cool.elasticsearch.operator.PrefixOperator Maven / Gradle / Ivy
package com.github.wz2cool.elasticsearch.operator;
import com.github.wz2cool.elasticsearch.model.FilterMode;
import org.elasticsearch.index.query.PrefixQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
public class PrefixOperator implements IFilterOperator {
private final String prefix;
public PrefixOperator(String prefix) {
this.prefix = prefix;
}
@Override
public FilterMode getDefaultFilterMode() {
return FilterMode.MUST;
}
@Override
public QueryBuilder buildQuery(String columnName) {
return new PrefixQueryBuilder(columnName, prefix);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy