org.elasticsearch.plugin.nlpcn.MultiRequestExecutorFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-sql Show documentation
Show all versions of elasticsearch-sql Show documentation
Query elasticsearch using SQL
The newest version!
package org.elasticsearch.plugin.nlpcn;
import org.elasticsearch.action.search.MultiSearchRequest;
import org.elasticsearch.action.search.MultiSearchRequestBuilder;
import org.elasticsearch.client.Client;
import org.nlpcn.es4sql.exception.SqlParseException;
import org.nlpcn.es4sql.query.multi.MultiQueryAction;
import org.nlpcn.es4sql.query.multi.MultiQueryRequestBuilder;
/**
* Created by Eliran on 21/8/2016.
*/
public class MultiRequestExecutorFactory {
public static ElasticHitsExecutor createExecutor(Client client,MultiQueryRequestBuilder builder) throws SqlParseException {
switch (builder.getRelation()){
case UNION_ALL:
case UNION:
return new UnionExecutor(client,builder);
case MINUS:
return new MinusExecutor(client,builder);
default:
throw new SqlParseException("only supports union, and minus operations");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy