Examples of queryString()


Examples of org.apache.lucene.queryParser.MultiFieldQueryParserSettings.queryString()

        if (qpSettings.analyzer() == null) {
            qpSettings.analyzer(parseContext.mapperService().searchAnalyzer());
        }

        if (qpSettings.escape()) {
            qpSettings.queryString(org.apache.lucene.queryParser.QueryParser.escape(qpSettings.queryString()));
        }

        Query query = parseContext.indexCache().queryParserCache().get(qpSettings);
        if (query != null) {
            return query;
View Full Code Here

Examples of org.apache.lucene.queryParser.MultiFieldQueryParserSettings.queryString()

            queryParser = parseContext.singleQueryParser(qpSettings);
        }


        try {
            query = queryParser.parse(qpSettings.queryString());
            query.setBoost(qpSettings.boost());
            query = optimizeQuery(fixNegativeQueryIfNeeded(query));
            parseContext.indexCache().queryParserCache().put(qpSettings, query);
            return query;
        } catch (ParseException e) {
View Full Code Here

Examples of org.apache.lucene.queryParser.MultiFieldQueryParserSettings.queryString()

            query.setBoost(qpSettings.boost());
            query = optimizeQuery(fixNegativeQueryIfNeeded(query));
            parseContext.indexCache().queryParserCache().put(qpSettings, query);
            return query;
        } catch (ParseException e) {
            throw new QueryParsingException(parseContext.index(), "Failed to parse query [" + qpSettings.queryString() + "]", e);
        }
    }
}
View Full Code Here

Examples of org.apache.lucene.queryParser.MultiFieldQueryParserSettings.queryString()

                        }
                    }
                }
            } else if (token.isValue()) {
                if ("query".equals(currentFieldName)) {
                    qpSettings.queryString(parser.text());
                } else if ("default_field".equals(currentFieldName) || "defaultField".equals(currentFieldName)) {
                    qpSettings.defaultField(parseContext.indexName(parser.text()));
                } else if ("default_operator".equals(currentFieldName) || "defaultOperator".equals(currentFieldName)) {
                    String op = parser.text();
                    if ("or".equalsIgnoreCase(op)) {
View Full Code Here

Examples of org.apache.lucene.queryParser.QueryParserSettings.queryString()

            while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
                if (token == XContentParser.Token.FIELD_NAME) {
                    currentFieldName = parser.currentName();
                } else if (token.isValue()) {
                    if ("query".equals(currentFieldName)) {
                        qpSettings.queryString(parser.text());
                    } else if ("boost".equals(currentFieldName)) {
                        qpSettings.boost(parser.floatValue());
                    } else if ("enable_position_increments".equals(currentFieldName) || "enablePositionIncrements".equals(currentFieldName)) {
                        qpSettings.enablePositionIncrements(parser.booleanValue());
                    } else if ("allow_leading_wildcard".equals(currentFieldName) || "allowLeadingWildcard".equals(currentFieldName)) {
View Full Code Here

Examples of org.apache.lucene.queryParser.QueryParserSettings.queryString()

                    }
                }
            }
            parser.nextToken();
        } else {
            qpSettings.queryString(parser.text());
            // move to the next token
            parser.nextToken();
        }

        if (qpSettings.analyzer() == null) {
View Full Code Here

Examples of org.apache.lucene.queryParser.QueryParserSettings.queryString()

        if (qpSettings.analyzer() == null) {
            qpSettings.analyzer(parseContext.mapperService().searchAnalyzer());
        }

        if (qpSettings.queryString() == null) {
            throw new QueryParsingException(parseContext.index(), "No value specified for term query");
        }

        if (qpSettings.escape()) {
            qpSettings.queryString(org.apache.lucene.queryParser.QueryParser.escape(qpSettings.queryString()));
View Full Code Here

Examples of org.apache.lucene.queryParser.QueryParserSettings.queryString()

        if (qpSettings.queryString() == null) {
            throw new QueryParsingException(parseContext.index(), "No value specified for term query");
        }

        if (qpSettings.escape()) {
            qpSettings.queryString(org.apache.lucene.queryParser.QueryParser.escape(qpSettings.queryString()));
        }

        Query query = parseContext.indexCache().queryParserCache().get(qpSettings);
        if (query != null) {
            return query;
View Full Code Here

Examples of org.apache.lucene.queryParser.QueryParserSettings.queryString()

        if (qpSettings.queryString() == null) {
            throw new QueryParsingException(parseContext.index(), "No value specified for term query");
        }

        if (qpSettings.escape()) {
            qpSettings.queryString(org.apache.lucene.queryParser.QueryParser.escape(qpSettings.queryString()));
        }

        Query query = parseContext.indexCache().queryParserCache().get(qpSettings);
        if (query != null) {
            return query;
View Full Code Here

Examples of org.apache.lucene.queryParser.QueryParserSettings.queryString()

        }

        MapperQueryParser queryParser = parseContext.singleQueryParser(qpSettings);

        try {
            query = queryParser.parse(qpSettings.queryString());
            query.setBoost(qpSettings.boost());
            query = optimizeQuery(fixNegativeQueryIfNeeded(query));
            parseContext.indexCache().queryParserCache().put(qpSettings, query);
            return query;
        } catch (ParseException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.