Esempio n. 1
0
 public WhereClause normalize(EvaluatingNormalizer normalizer) {
   if (noMatch || query == null) {
     return this;
   }
   Symbol normalizedQuery = normalizer.normalize(query);
   if (normalizedQuery == query) {
     return this;
   }
   WhereClause normalizedWhereClause =
       new WhereClause(normalizedQuery, docKeys.orNull(), partitions);
   normalizedWhereClause.clusteredBy = clusteredBy;
   return normalizedWhereClause;
 }
Esempio n. 2
0
 public Context convert(
     WhereClause whereClause,
     MapperService mapperService,
     IndexFieldDataService indexFieldDataService,
     IndexCache indexCache)
     throws UnsupportedFeatureException {
   Context ctx = new Context(inputSymbolVisitor, mapperService, indexFieldDataService, indexCache);
   if (whereClause.noMatch()) {
     ctx.query = Queries.newMatchNoDocsQuery();
   } else if (!whereClause.hasQuery()) {
     ctx.query = Queries.newMatchAllQuery();
   } else {
     ctx.query = VISITOR.process(whereClause.query(), ctx);
   }
   if (LOGGER.isTraceEnabled()) {
     if (whereClause.hasQuery()) {
       LOGGER.trace(
           "WHERE CLAUSE [{}] -> LUCENE QUERY [{}] ",
           SymbolFormatter.format(whereClause.query()),
           ctx.query);
     }
   }
   return ctx;
 }