All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.wz2cool.elasticsearch.query.builder.MatchExtQueryBuilder Maven / Gradle / Ivy

There is a newer version: 0.1.6
Show newest version
package com.github.wz2cool.elasticsearch.query.builder;

import com.github.wz2cool.elasticsearch.lambda.GetStringPropertyFunction;
import com.github.wz2cool.elasticsearch.model.ColumnInfo;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;

public class MatchExtQueryBuilder implements ExtQueryBuilder {

    private final GetStringPropertyFunction getPropertyFunc;
    private final String text;

    public MatchExtQueryBuilder(GetStringPropertyFunction getPropertyFunc, String text) {
        this.getPropertyFunc = getPropertyFunc;
        this.text = text;
    }

    @Override
    public QueryBuilder build() {
        final ColumnInfo columnInfo = getColumnInfo(this.getPropertyFunc);
        return new MatchQueryBuilder(columnInfo.getColumnName(), this.text);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy