Examples of QParser


Examples of org.apache.solr.search.QParser

   */
  private void addNestedQuery(final BooleanQuery main, final SolrParams solrParams)
  throws ParseException {
    if (solrParams.getParams("nested") != null) {
      for (final String nested : solrParams.getParams("nested")) {
        final QParser baseParser = this.subQuery(nested, null);
        main.add(baseParser.getQuery(), Occur.MUST);
      }
    }
  }
View Full Code Here

Examples of org.apache.solr.search.QParser

      if (rb.getQueryString() == null) {
        rb.setQueryString( qString);
      }

      try {
        QParser parser = QParser.getParser(rb.getQueryString(), defType, rb.req);
        rb.setQuery( parser.getQuery() );
        rb.setSortSpec( parser.getSort(true) );
        rb.setQparser(parser);

       
        String[] fqs = params.getParams(CommonParams.FQ);
        if (fqs!=null && fqs.length!=0) {
          List<Query> filters = rb.getFilters();
          if (filters==null) {
            filters = new ArrayList<Query>();
            rb.setFilters( filters );
          }
          for (String fq : fqs) {
            if (fq != null && fq.trim().length()!=0) {
              QParser fqp = QParser.getParser(fq, null, rb.req);
              filters.add(fqp.getQuery());
            }
          }
        } 
      } catch (ParseException e) {
        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, 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.