Examples of queryString()


Examples of org.apache.lucene.queryParser.QueryParserSettings.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.classic.QueryParserSettings.queryString()

    @Test
    public void testCaching() throws Exception {
        ResidentQueryParserCache cache = new ResidentQueryParserCache(new Index("test"), ImmutableSettings.EMPTY);
        QueryParserSettings key = new QueryParserSettings();
        key.queryString("abc");
        key.defaultField("a");
        key.boost(2.0f);

        Query query = new TermQuery(new Term("a", "abc"));
        cache.put(key, query);
View Full Code Here

Examples of org.apache.lucene.queryparser.classic.QueryParserSettings.queryString()

                } else {
                    throw new QueryParsingException(parseContext.index(), "[query_string] query does not support [" + currentFieldName + "]");
                }
            } else if (token.isValue()) {
                if ("query".equals(currentFieldName)) {
                    qpSettings.queryString(parser.text());
                } else if ("default_field".equals(currentFieldName) || "defaultField".equals(currentFieldName)) {
                    qpSettings.defaultField(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.classic.QueryParserSettings.queryString()

                } else {
                    throw new QueryParsingException(parseContext.index(), "[query_string] query does not support [" + currentFieldName + "]");
                }
            }
        }
        if (qpSettings.queryString() == null) {
            throw new QueryParsingException(parseContext.index(), "query_string must be provided with a [query]");
        }
        qpSettings.defaultAnalyzer(parseContext.mapperService().searchAnalyzer());
        qpSettings.defaultQuoteAnalyzer(parseContext.mapperService().searchQuoteAnalyzer());
View Full Code Here

Examples of org.apache.lucene.queryparser.classic.QueryParserSettings.queryString()

        }
        qpSettings.defaultAnalyzer(parseContext.mapperService().searchAnalyzer());
        qpSettings.defaultQuoteAnalyzer(parseContext.mapperService().searchQuoteAnalyzer());

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

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

Examples of org.apache.lucene.queryparser.classic.QueryParserSettings.queryString()

        }
        qpSettings.defaultAnalyzer(parseContext.mapperService().searchAnalyzer());
        qpSettings.defaultQuoteAnalyzer(parseContext.mapperService().searchQuoteAnalyzer());

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

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

Examples of org.apache.lucene.queryparser.classic.QueryParserSettings.queryString()

        }

        MapperQueryParser queryParser = parseContext.queryParser(qpSettings);

        try {
            query = queryParser.parse(qpSettings.queryString());
            if (query == null) {
                return null;
            }
            if (qpSettings.boost() != QueryParserSettings.DEFAULT_BOOST) {
                query.setBoost(query.getBoost() * qpSettings.boost());
 
View Full Code Here

Examples of org.apache.lucene.queryparser.classic.QueryParserSettings.queryString()

            if (queryName != null) {
                parseContext.addNamedQuery(queryName, query);
            }
            return query;
        } catch (org.apache.lucene.queryparser.classic.ParseException e) {
            throw new QueryParsingException(parseContext.index(), "Failed to parse query [" + qpSettings.queryString() + "]", e);
        }
    }
}
View Full Code Here

Examples of org.apache.tomcat.core.Request.queryString()

  if( queryString != null ) {
      // Process existing parameters, if not already done so
      // ( otherwise we'll process some twice )
      realRequest.parameters().handleQueryParameters();
      // Set the query string - the sum of the new one and old one.
      String oldQS=realRequest.queryString().toString();
      String newQS=(oldQS==null ) ? queryString : queryString + "&" +
    oldQS;
      realRequest.queryString().setString(newQS);

      // Process the additional parsm. We don't know if the old
View Full Code Here

Examples of org.apache.tomcat.core.Request.queryString()

      realRequest.parameters().handleQueryParameters();
      // Set the query string - the sum of the new one and old one.
      String oldQS=realRequest.queryString().toString();
      String newQS=(oldQS==null ) ? queryString : queryString + "&" +
    oldQS;
      realRequest.queryString().setString(newQS);

      // Process the additional parsm. We don't know if the old
      // params were processed ( so we need to make sure they are,
      // i.e. a known state ).
      realRequest.parameters().push();
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.