Returns the {@link Search} contained in the specified list of {@link IndexExpression}s.

@param clause A list of {@link IndexExpression}s.
@return The {@link Search} contained in the specified list of {@link IndexExpression}s.
333735
private Search search(List<IndexExpression> clause) {
        IndexExpression indexedExpression = indexedExpression(clause);
        String json = UTF8Type.instance.compose(indexedExpression.value);
        return Search.fromJson(json);
    }
926659
private <E> List<E> onIndexSearch(OracleNoSQLQueryInterpreter interpreter, EntityMetadata entityMetadata,
            MetamodelImpl metamodel, List<E> results, List<String> columnsToSelect)
    {
        Map<String, List> indexes = new HashMap<String, List>();
        StringBuilder indexNamebuilder = new StringBuilder();

        for (Object clause : interpreter.getClauseQueue())
        {
            if (clause.getClass().isAssignableFrom(FilterClause.class))
            {
                String fieldName = null;

                String clauseName = ((FilterClause) clause).getProperty();
                StringTokenizer stringTokenizer = new StringTokenizer(clauseName, ".");
                // if need to select embedded columns
                if (stringTokenizer.countTokens() > 1)
                {
                    fieldName = stringTokenizer.nextToken();
                }

                fieldName = stringTokenizer.nextToken();
                Object value = ((FilterClause) clause).getValue();
                if (!indexes.containsKey(fieldName))
                {
                    indexNamebuilder.append(fieldName);
                    indexNamebuilder.append(",");
                }
                indexes.put(fieldName, (List) value);
            }
            else
            {
                if (clause.toString().equalsIgnoreCase("OR"))
                {
                    throw new QueryHandlerException("OR clause is not supported with oracle nosql db");
                }
            }
        }

        // prepare index name and value.
        Table schemaTable = tableAPI.getTable(entityMetadata.getTableName());
        String indexKeyName = indexNamebuilder.deleteCharAt(indexNamebuilder.length() - 1).toString();
        Index index = schemaTable.getIndex(entityMetadata.getIndexProperties().get(indexKeyName).getName());
        IndexKey indexKey = index.createIndexKey();

        // StringBuilder indexNamebuilder = new StringBuilder();
        for (String indexName : indexes.keySet())
        {
            NoSqlDBUtils.add(schemaTable.getField(indexName), indexKey, indexes.get(indexName).get(0), indexName);
        }

        Iterator<Row> rowsIter = tableAPI.tableIterator(indexKey, null, null);

        Map<String, Object> relationMap = initialize(entityMetadata);

        try
        {
            results = scrollAndPopulate(null, entityMetadata, metamodel, schemaTable, rowsIter, relationMap,
                    columnsToSelect);
            KunderaCoreUtils.printQueryWithFilterClause(interpreter.getClauseQueue(), entityMetadata.getTableName());
        }
        catch (Exception e)
        {
            log.error("Error while finding records , Caused By :" + e + ".");
            throw new PersistenceException(e);
        }

        return results;
    }
895031
def get_unique_clause_indices( text ):
    '''  '''
    # Add clause boundary annotation (if missing)
    if not text.is_tagged( CLAUSES ):
        text.tag_clauses()
    # Collect (unique) clause indices over the whole text
    clause_indices = []
    sent_id = 0
    for sub_text in text.split_by( SENTENCES ):
        for word, cl_index in zip( sub_text.words, sub_text.clause_indices ):
            clause_indices.append( sent_id+cl_index )
        nr_of_clauses = len(set(sub_text.clause_indices))
        sent_id += nr_of_clauses
    assert len(clause_indices) == len(text.words), '(!) Number of clause indices should match nr of words!'
    return clause_indices
465482
@Override
    public List<SearchResult> search(EntityMetadata m, String persistenceUnit, ConsistencyLevel consistencyLevel,
            Map<Boolean, List<IndexClause>> indexClauseMap)
    {

        return super.search(m, persistenceUnit, consistencyLevel, indexClauseMap);
    }
516459
@SequentialOnly
    public static <T> Predicate<T> indexed(final IndexedPredicate<T> predicate) {
        return Predicates.indexed(predicate);
    }
996774
public static <T> JPQLQuery<T> select(Expression<T> expr) {
        return new JPASubQuery<Void>().select(expr);
    }
773909
function (clause) {
            var cond = argsToArray(arguments).slice(1), cb;
            if (cond.length && isFunction(cond[cond.length - 1])) {
                cb = cond.pop();
            }
            cond = cond.length === 1 ? cond[0] : cond;
            if ((cond == null || cond === undefined || cond === "") || (Array.isArray(cond) && cond.length === 0 && !cb) || (isObject(cond) && isEmpty(cond) && !cb)) {
                return this.mergeOptions();
            } else {
                cond = this._filterExpr(cond, cb);
                var cl = this.__opts[clause];
                cl && (cond = new BooleanExpression("AND", cl, cond));
                var opts = {};
                opts[clause] = cond;
                return this.mergeOptions(opts);
            }
        }
292555
public static List<Condition> getConditions(String query)
            throws QueryParseException {
        StringBuffer prop = new StringBuffer();
        Operator oper = null;
        StringBuffer val = new StringBuffer();
        ArrayList<Condition> ret = new ArrayList<Condition>();
        boolean inProp = true;
        boolean inValue = false;
        boolean firstValueChar = false;
        boolean valueStartsWithQuote = false;
        for (int i = 0; i < query.length(); i++) {
            char c = query.charAt(i);
            if (inProp) {
                if (c == '=') {
                    oper = Operator.EQUALS;
                    inProp = false;
                    inValue = true;
                    firstValueChar = true;
                } else if (c == '~') {
                    oper = Operator.CONTAINS;
                    inProp = false;
                    inValue = true;
                    firstValueChar = true;
                } else if (c == '>') {
                    if (i + 1 < query.length()) {
                        char d = query.charAt(i + 1);
                        if (d == '=') {
                            i++;
                            oper = Operator.GREATER_OR_EQUAL;
                        } else {
                            oper = Operator.GREATER_THAN;
                        }
                        inProp = false;
                        inValue = true;
                        firstValueChar = true;
                    } else {
                        throw new QueryParseException("Found <end-of-string> "
                                + "immediately following '>' operator, but "
                                + "expected a value.");
                    }
                } else if (c == '<') {
                    if (i + 1 < query.length()) {
                        char d = query.charAt(i + 1);
                        if (d == '=') {
                            i++;
                            oper = Operator.LESS_OR_EQUAL;
                        } else {
                            oper = Operator.LESS_THAN;
                        }
                        inProp = false;
                        inValue = true;
                        firstValueChar = true;
                    } else {
                        throw new QueryParseException("Found <end-of-string> "
                                + "immediately following '<' operator, but "
                                + "expected a value.");
                    }
                } else if ((c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A)) {
                    prop.append(c);
                } else {
                    throw new QueryParseException("Found ' " + c
                            + "' at character " + i
                            + " but expected operator");
                }
            } else if (inValue) {
                if (prop.toString().length() == 0) {
                    throw new QueryParseException("Found "
                            + "operator but expected a non-zero length "
                            + "property.");
                }
                if (firstValueChar) {
                    // allow ', and mark it if it's there, add one to i
                    if (c == '\'') {
                        i++;
                        if (i >= query.length()) {
                            throw new QueryParseException("Found <end-of-string> "
                                    + "immediately following start quote, but "
                                    + "expected a value.");
                        }
                        c = query.charAt(i);
                        valueStartsWithQuote = true;
                    }
                    firstValueChar = false;
                }
                if (c == '\'') {
                    if (!valueStartsWithQuote) {
                        throw new QueryParseException("Found ' character in "
                                + "value at position " + i + ", but the value "
                                + "did not start with a string, so this can't "
                                + " be a value terminator.");
                    }
                    // end of value part
                    // next must be space or empty... check
                    i++;
                    if (i < query.length()) {
                        if (query.charAt(i) != ' ') {
                            throw new QueryParseException("Found value-terminator "
                                    + "' but it was not followed by <end-of-string> "
                                    + "or <space>.");
                        }
                    }
                    ret
                            .add(new Condition(prop.toString(), oper, val
                                    .toString()));
                    prop = new StringBuffer();
                    oper = null;
                    val = new StringBuffer();
                    inValue = false;
                    inProp = true;
                    valueStartsWithQuote = false;
                } else if (c == '\\') {
                    i++;
                    if (i >= query.length()) {
                        throw new QueryParseException("Found character-escaping "
                                + "character as last item in string.");
                    }
                    val.append(query.charAt(i));
                } else if (c == ' ') {
                    // end of value part... or inside string?
                    if (valueStartsWithQuote) {
                        // was inside string..ok
                        val.append(c);
                    } else {
                        // end of value part...cuz not quotes
                        ret.add(new Condition(prop.toString(), oper, val
                                .toString()));
                        prop = new StringBuffer();
                        oper = null;
                        val = new StringBuffer();
                        inValue = false;
                        inProp = true;
                    }
                } else if (c == '=') {
                    throw new QueryParseException("Found <operator> at position "
                            + i + ", but expected <value>");
                } else if (c == '~') {
                    throw new QueryParseException("Found <operator> at position "
                            + i + ", but expected <value>");
                } else if (c == '>') {
                    throw new QueryParseException("Found <operator> at position "
                            + i + ", but expected <value>");
                } else if (c == '<') {
                    throw new QueryParseException("Found <operator> at position "
                            + i + ", but expected <value>");
                } else {
                    val.append(c);
                }
            }
        }
        if (inProp) {
            if (prop.toString().length() > 0) {
                throw new QueryParseException("String ended before operator "
                        + "was found");
            }
        }
        if (inValue) {
            if (valueStartsWithQuote) {
                throw new QueryParseException("String ended before quoted value"
                        + "'s ending quote.");
            }
            ret.add(new Condition(prop.toString(), oper, val.toString()));
        }
        return ret;
    }
140895
public static boolean match(String keyword, String query) {
		if (query.indexOf(keyword) != -1) { // match found!
			return true;
		}
		return false;
	}
263773
public static <T> SQLQuery<T> select(Expression<T> expr) {
        return new SQLQuery<Void>().select(expr);
    }
428852
private List<IndexExpression> filteredExpressions(List<IndexExpression> clause) {
        List<IndexExpression> filteredExpressions = new ArrayList<>(clause.size());
        for (IndexExpression ie : clause) {
            ByteBuffer columnName = ie.column;
            if (!indexedColumnName.equals(columnName)) {
                filteredExpressions.add(ie);
            }
        }
        return filteredExpressions;
    }
839379
public static Pattern findSubstructure(IAtomContainer query) {
        boolean isQuery = query instanceof IQueryAtomContainer;
        return findSubstructure(query,
                                isQuery ? AtomMatcher.forQuery() : AtomMatcher.forElement(),
                                isQuery ? BondMatcher.forQuery() : BondMatcher.forOrder());
    }
1100118
private QueryBuilder getQueryBuilder(FilterClause clause, final EntityMetadata metadata)
    {
        String condition = clause.getCondition();
        String value = clause.getValue().get(0).toString();
        String name = ((AbstractAttribute) ((MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                metadata.getPersistenceUnit())).entity(metadata.getEntityClazz()).getAttribute(clause.getProperty()))
                .getJPAColumnName();

        String likePattern = value.contains(ESConstants.PERCENTAGE) ? value.replaceAll(ESConstants.PERCENTAGE,
                ESConstants.ASTERISK) : ESConstants.ASTERISK + value + ESConstants.ASTERISK;

        QueryBuilder queryBuilder = null;
        if (condition.equals(Expression.LIKE))
        {
            queryBuilder = QueryBuilders.wildcardQuery(name, likePattern);
        }

        return QueryBuilders.queryFilter(queryBuilder);
    }
1302678
def clause_annotations(self):
        """"""
        if not self.is_tagged(CLAUSE_ANNOTATION):
            self.tag_clause_annotations()
        return [word.get(CLAUSE_ANNOTATION, None) for word in self[WORDS]]
1298669
public boolean isIndexed(String expression) {
    if (expression == null || expression.length() == 0) { return false; }
    for (int i = 0; i < expression.length(); i++) {
      char c = expression.charAt(i);
      if (c == Nested || c == MappedStart) {
        return false;
      } else if (c == IndexedStart) { return true; }
    }
    return false;
  }
250867
public static <T> Query<T> queryWithPage(ExpressionList<T> expressionList, Pageable pageable) {
        Assert.notNull(expressionList, "expressionList must not null");
        Assert.notNull(pageable, "pageable must not null");
        return expressionList.setMaxRows(pageable.getPageSize())
                .setFirstRow((int) pageable.getOffset())
                .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()));
    }
726458
@Override
    public List<AbstractExpression> bindingToIndexedExpression(AbstractExpression expr) {
        if (m_originalValue == null || ! m_originalValue.equals(expr)) {
            return null;
        }
        // This parameter's value was matched, so return this as one bound parameter.
        List<AbstractExpression> result = new ArrayList<AbstractExpression>();
        result.add(this);
        return result;
    }