Search in sources :

Example 6 with DslQuery

use of io.vertigo.dynamox.search.dsl.model.DslQuery in project vertigo by KleeGroup.

the class DslMultiQueryRule method handle.

/**
 * {@inheritDoc}
 */
@Override
protected DslBlockQuery handle(final List<Object> parsing) {
    final String preQuery = (String) parsing.get(0);
    final List<DslQuery> queryDefinitions = new ArrayList<>();
    final String postQuery = (String) parsing.get(4);
    final List<PegChoice> manyQueries = (List<PegChoice>) parsing.get(2);
    for (final PegChoice item : manyQueries) {
        queryDefinitions.add((DslQuery) item.getValue());
    }
    return new DslBlockQuery(preQuery, queryDefinitions, postQuery);
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) DslBlockQuery(io.vertigo.dynamox.search.dsl.model.DslBlockQuery) PegChoice(io.vertigo.commons.peg.PegChoice) DslQuery(io.vertigo.dynamox.search.dsl.model.DslQuery)

Aggregations

DslQuery (io.vertigo.dynamox.search.dsl.model.DslQuery)6 PegChoice (io.vertigo.commons.peg.PegChoice)3 DslFixedQuery (io.vertigo.dynamox.search.dsl.model.DslFixedQuery)2 List (java.util.List)2 DslBlockQuery (io.vertigo.dynamox.search.dsl.model.DslBlockQuery)1 DslExpression (io.vertigo.dynamox.search.dsl.model.DslExpression)1 DslField (io.vertigo.dynamox.search.dsl.model.DslField)1 DslMultiField (io.vertigo.dynamox.search.dsl.model.DslMultiField)1 DslRangeQuery (io.vertigo.dynamox.search.dsl.model.DslRangeQuery)1 DslTermQuery (io.vertigo.dynamox.search.dsl.model.DslTermQuery)1 ArrayList (java.util.ArrayList)1