Java Code Examples for org.apache.solr.search.QParser

The following examples show how to use org.apache.solr.search.QParser. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public Query parse() throws SyntaxError {
    String reRankQueryString = localParams.get("reRankQuery");
    boolean scale = localParams.getBool("scale", false);
    QParser reRankParser = QParser.getParser(reRankQueryString, null, req);
    Query reRankQuery = reRankParser.parse();

    int reRankDocs  = localParams.getInt("reRankDocs", 200);
    reRankDocs = Math.max(1, reRankDocs); //

    double reRankWeight = localParams.getDouble("reRankWeight",2.0d);

    int start = params.getInt(CommonParams.START,0);
    int rows = params.getInt(CommonParams.ROWS,10);
    int length = start+rows;
    return new ReRankQuery(reRankQuery, reRankDocs, reRankWeight, length, scale);
}
 
Example 2
Source Project: lucene-solr   Source File: AbstractSpatialFieldType.java    License: Apache License 2.0 6 votes vote down vote up
protected Query getQueryFromSpatialArgs(QParser parser, SchemaField field, SpatialArgs spatialArgs) {
  T strategy = getStrategy(field.getName());

  SolrParams localParams = parser.getLocalParams();
  //See SOLR-2883 needScore
  String scoreParam = (localParams == null ? null : localParams.get(SCORE_PARAM));

  //We get the valueSource for the score then the filter and combine them.
  DoubleValuesSource valueSource = getValueSourceFromSpatialArgs(parser, field, spatialArgs, scoreParam, strategy);
  if (valueSource == null) {
    return strategy.makeQuery(spatialArgs); //assumed constant scoring
  }

  FunctionScoreQuery functionQuery = new FunctionScoreQuery(new MatchAllDocsQuery(), valueSource);

  if (localParams != null && !localParams.getBool(FILTER_PARAM, true))
    return functionQuery;

  Query filterQuery = strategy.makeQuery(spatialArgs);
  return new BooleanQuery.Builder()
      .add(functionQuery, Occur.MUST)//matches everything and provides score
      .add(filterQuery, Occur.FILTER)//filters (score isn't used)
      .build();
}
 
Example 3
Source Project: lucene-solr   Source File: QueryFacet.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void createFacetValueExecuters(final Filter filter, SolrQueryRequest queryRequest, Consumer<FacetValueQueryExecuter> consumer) {
  queries.forEach( (queryName, query) -> {
    final Query q;
    try {
      q = QParser.getParser(query, queryRequest).getQuery();
    } catch( Exception e ){
      throw new SolrException(ErrorCode.BAD_REQUEST,"Invalid query '"+query+"' in query facet '" + getName() + "'",e);
    }
    // The searcher sends docIds to the QueryFacetAccumulator which forwards
    // them to <code>collectQuery()</code> in this class for collection.
    Query queryQuery = QueryUtils.combineQueryAndFilter(q, filter);

    ReductionDataCollection dataCol = collectionManager.newDataCollection();
    reductionData.put(queryName, dataCol);
    consumer.accept(new FacetValueQueryExecuter(dataCol, queryQuery));
  });
}
 
Example 4
Source Project: lucene-solr   Source File: DirectUpdateHandler2.java    License: Apache License 2.0 6 votes vote down vote up
private Query getQuery(DeleteUpdateCommand cmd) {
  Query q;
  try {
    // move this higher in the stack?
    QParser parser = QParser.getParser(cmd.getQuery(), cmd.req);
    q = parser.getQuery();
    q = QueryUtils.makeQueryable(q);

    // Make sure not to delete newer versions
    if (ulog != null && cmd.getVersion() != 0 && cmd.getVersion() != -Long.MAX_VALUE) {
      BooleanQuery.Builder bq = new BooleanQuery.Builder();
      bq.add(q, Occur.MUST);
      SchemaField sf = ulog.getVersionInfo().getVersionField();
      ValueSource vs = sf.getType().getValueSource(sf, null);
      ValueSourceRangeFilter filt = new ValueSourceRangeFilter(vs, Long.toString(Math.abs(cmd.getVersion())), null, true, true);
      FunctionRangeQuery range = new FunctionRangeQuery(filt);
      bq.add(range, Occur.MUST_NOT);  // formulated in the "MUST_NOT" sense so we can delete docs w/o a version (some tests depend on this...)
      q = bq.build();
    }

    return q;

  } catch (SyntaxError e) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
  }
}
 
Example 5
Source Project: lucene-solr   Source File: TaggerRequestHandler.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * The set of documents matching the provided 'fq' (filter query). Don't include deleted docs
 * either. If null is returned, then all docs are available.
 */
private Bits computeDocCorpus(SolrQueryRequest req) throws SyntaxError, IOException {
  final String[] corpusFilterQueries = req.getParams().getParams("fq");
  final SolrIndexSearcher searcher = req.getSearcher();
  final Bits docBits;
  if (corpusFilterQueries != null && corpusFilterQueries.length > 0) {
    List<Query> filterQueries = new ArrayList<Query>(corpusFilterQueries.length);
    for (String corpusFilterQuery : corpusFilterQueries) {
      QParser qParser = QParser.getParser(corpusFilterQuery, null, req);
      try {
        filterQueries.add(qParser.parse());
      } catch (SyntaxError e) {
        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
      }
    }

    final DocSet docSet = searcher.getDocSet(filterQueries);//hopefully in the cache

    docBits = docSet.getBits();
  } else {
    docBits = searcher.getSlowAtomicReader().getLiveDocs();
  }
  return docBits;
}
 
Example 6
Source Project: lucene-solr   Source File: SortableTextField.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public ValueSource getSingleValueSource(MultiValueSelector choice, SchemaField field, QParser parser) {
  // trivial base case
  if (!field.multiValued()) {
    // single value matches any selector
    return getValueSource(field, parser);
  }
  
  // See LUCENE-6709
  if (! field.hasDocValues()) {
    // type defaults to docValues=true, so error msg from perspective that
    // either type or field must have docValues="false"
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
                            "Can not select  '" + choice.toString() + "' value from multivalued field ("+
                            field.getName() +") when docValues=\"false\", field: " + field.getName());
  }
  SortedSetSelector.Type selectorType = choice.getSortedSetSelectorType();
  if (null == selectorType) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
                            choice.toString() + " is not a supported option for picking a single value"
                            + " from the multivalued field: " + field.getName() +
                            " (type: " + this.getTypeName() + ")");
  }
  
  return new SortedSetFieldSource(field.getName(), selectorType);
}
 
Example 7
Source Project: lucene-solr   Source File: LongPointField.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Query getPointRangeQuery(QParser parser, SchemaField field, String min, String max, boolean minInclusive,
    boolean maxInclusive) {
  long actualMin, actualMax;
  if (min == null) {
    actualMin = Long.MIN_VALUE;
  } else {
    actualMin = parseLongFromUser(field.getName(), min);
    if (!minInclusive) {
      if (actualMin == Long.MAX_VALUE) return new MatchNoDocsQuery();
      actualMin++;
    }
  }
  if (max == null) {
    actualMax = Long.MAX_VALUE;
  } else {
    actualMax = parseLongFromUser(field.getName(), max);
    if (!maxInclusive) {
      if (actualMax == Long.MIN_VALUE) return new MatchNoDocsQuery();
      actualMax--;
    }
  }
  return LongPoint.newRangeQuery(field.getName(), actualMin, actualMax);
}
 
Example 8
Source Project: SolRDF   Source File: LocalGraph.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Builds a new {@link LocalGraph} with the given data.
 * 
 * @param graphNode the graph name.
 * @param request the Solr query request.
 * @param response the Solr query response.
 * @param qparser the query parser.
 * @param fetchSize the fetch size that will be used in reads.
 * @param consumer the Graph event consumer that will be notified on relevant events.
 */
private LocalGraph(
	final Node graphNode, 
	final SolrQueryRequest request, 
	final SolrQueryResponse response, 
	final QParser qparser, 
	final int fetchSize, 
	final GraphEventConsumer consumer) {
	super(graphNode, consumer, fetchSize);
	this.graphTermQuery = new TermQuery(new Term(Field.C, graphNodeStringified));
	this.request = request;
	this.updateCommand = new AddUpdateCommand(request);
	this.updateProcessor = request.getCore().getUpdateProcessingChain(null).createProcessor(request, response);
	this.searcher = request.getSearcher();
	this.qParser = qparser;
}
 
Example 9
Source Project: querqy   Source File: AbstractQuerqyDismaxQParserPlugin.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public final QParser createParser(final String qstr, final SolrParams localParams, final SolrParams params,
                                  SolrQueryRequest req) {

    if (termQueryCacheName == null) {
        return createParser(qstr, localParams, params, req, infoLogging, null);
    } else {

        @SuppressWarnings("unchecked")
        final SolrCache<CacheKey, TermQueryCacheValue> solrCache = req.getSearcher().getCache(termQueryCacheName);
        if (solrCache == null) {
            logger.warn("Missing Solr cache {}", termQueryCacheName);
            return createParser(qstr, localParams, params, req, infoLogging, null);
        } else {
            return createParser(qstr, localParams, params, req, infoLogging,
                    new SolrTermQueryCacheAdapter(ignoreTermQueryCacheUpdates, solrCache));
        }

    }
}
 
Example 10
Source Project: querqy   Source File: QuerqyQueryComponent.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void prepare(final ResponseBuilder rb) throws IOException {

    super.prepare(rb);
    
    QParser parser = rb.getQparser();
    
    if (parser instanceof QuerqyDismaxQParser) {
    
        List<Query> filterQueries = ((QuerqyDismaxQParser) parser).getFilterQueries();
        if ((filterQueries != null) && !filterQueries.isEmpty()) {
            List<Query> filters = rb.getFilters();
            if (filters == null) {
                rb.setFilters(filterQueries);
            } else {
                filters.addAll(filterQueries);
            }
        }

    }
}
 
Example 11
Source Project: lucene-solr   Source File: IntPointField.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Query getPointRangeQuery(QParser parser, SchemaField field, String min, String max, boolean minInclusive,
    boolean maxInclusive) {
  int actualMin, actualMax;
  if (min == null) {
    actualMin = Integer.MIN_VALUE;
  } else {
    actualMin = parseIntFromUser(field.getName(), min);
    if (!minInclusive) {
      if (actualMin == Integer.MAX_VALUE) return new MatchNoDocsQuery();
      actualMin++;
    }
  }
  if (max == null) {
    actualMax = Integer.MAX_VALUE;
  } else {
    actualMax = parseIntFromUser(field.getName(), max);
    if (!maxInclusive) {
      if (actualMax == Integer.MIN_VALUE) return new MatchNoDocsQuery();
      actualMax--;
    }
  }
  return IntPoint.newRangeQuery(field.getName(), actualMin, actualMax);
}
 
Example 12
Source Project: wiseowl   Source File: WiseOwlQParserPlugin.java    License: MIT License 5 votes vote down vote up
@Override
public QParser createParser(String qStr, SolrParams localParams, SolrParams params,
                            SolrQueryRequest req) {
  answerTypeMap = new HashMap<String, String>();//<co id="qqpp.atm"/>
  answerTypeMap.put("L", "NE_LOCATION");
  answerTypeMap.put("T", "NE_TIME|NE_DATE");
  answerTypeMap.put("P", "NE_PERSON");
  answerTypeMap.put("M", "NE_MONEY");
  answerTypeMap.put("O", "NE_ORGANIZATION");
  answerTypeMap.put("L", "NE_LOCATION");
  answerTypeMap.put("C", "NE_PERCENT");
  answerTypeMap.put("F", "DESCRIPTION");
  answerTypeMap.put("X", "OTHERS");
  QParser qParser;
  if (params.getBool(OWLParams.COMPONENT_NAME, false) == true //<co id="qqpp.explainif"/>
          && qStr.equals("*:*") == false) {
    AnswerTypeClassifier atc =
            new AnswerTypeClassifier(model, probs, atcg);//<co id="qqpp.atc"/>
    Parser parser = new ChunkParser(chunker, tagger);//<co id="qqpp.parser"/>
    qParser = new WiseOwlQParser(qStr, localParams, //<co id="qqpp.construct"/>
            params, req, parser, atc, answerTypeMap);
  } else {
    //just do a regular query if OWL is turned off
    qParser = req.getCore().getQueryPlugin("edismax")
            .createParser(qStr, localParams, params, req);
  }
  return qParser;
}
 
Example 13
Source Project: lucene-solr   Source File: LatLonType.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Query getFieldQuery(QParser parser, SchemaField field, String externalVal) {
  Point p1 = SpatialUtils.parsePointSolrException(externalVal, SpatialContext.GEO);

  SchemaField latSF = subField(field, LAT, parser.getReq().getSchema());
  SchemaField lonSF = subField(field, LON, parser.getReq().getSchema());
  BooleanQuery.Builder result = new BooleanQuery.Builder();
  result.add(latSF.getType().getFieldQuery(parser, latSF,
      Double.toString(p1.getY())), BooleanClause.Occur.MUST);
  result.add(lonSF.getType().getFieldQuery(parser, lonSF,
      Double.toString(p1.getX())), BooleanClause.Occur.MUST);
  return result.build();
}
 
Example 14
@Override
public Query getRangeQuery(QParser parser, SchemaField field, String part1, String part2, boolean minInclusive, boolean maxInclusive)
{
    Analyzer multiAnalyzer = constructMultiTermAnalyzer(getQueryAnalyzer());
    BytesRef lower = analyzeMultiTerm(field.getName(), part1, multiAnalyzer);
    BytesRef upper = analyzeMultiTerm(field.getName(), part2, multiAnalyzer);
    return new TermRangeQuery(field.getName(), lower, upper, minInclusive, maxInclusive);
}
 
Example 15
Source Project: lucene-solr   Source File: CurrencyFieldType.java    License: Apache License 2.0 5 votes vote down vote up
public RawCurrencyValueSource(SchemaField sfield, String targetCurrencyCode, QParser parser) {
  this.sf = sfield;
  this.targetCurrency = getCurrency(targetCurrencyCode);
  if (null == targetCurrency) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Currency code not supported by this JVM: " + targetCurrencyCode);
  }

  SchemaField amountField = getAmountField(sf);
  SchemaField currencyField = getCurrencyField(sf);

  currencyValues = currencyField.getType().getValueSource(currencyField, parser);
  amountValues = amountField.getType().getValueSource(amountField, parser);
}
 
Example 16
Source Project: lucene-solr   Source File: TrieField.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public final ValueSource getSingleValueSource(MultiValueSelector choice, SchemaField field, QParser parser) {
  // trivial base case
  if (!field.multiValued()) {
    // single value matches any selector
    return getValueSource(field, parser);
  }

  // See LUCENE-6709
  if (! field.hasDocValues()) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
                            "docValues='true' is required to select '" + choice.toString() +
                            "' value from multivalued field ("+ field.getName() +") at query time");
  }
  
  // multivalued Trie fields all use SortedSetDocValues, so we give a clean error if that's
  // not supported by the specified choice, else we delegate to a helper
  SortedSetSelector.Type selectorType = choice.getSortedSetSelectorType();
  if (null == selectorType) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
                            choice.toString() + " is not a supported option for picking a single value"
                            + " from the multivalued field: " + field.getName() +
                            " (type: " + this.getTypeName() + ")");
  }
  
  return getSingleValueSource(selectorType, field);
}
 
Example 17
Source Project: lucene-solr   Source File: ICUCollationField.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Query getSpecializedRangeQuery(QParser parser, SchemaField field, String part1, String part2, boolean minInclusive, boolean maxInclusive) {
  String f = field.getName();
  BytesRef low = part1 == null ? null : getCollationKey(f, part1);
  BytesRef high = part2 == null ? null : getCollationKey(f, part2);
  if (!field.indexed() && field.hasDocValues()) {
    return SortedSetDocValuesField.newSlowRangeQuery(
        field.getName(), low, high, minInclusive, maxInclusive);
  } else {
    return new TermRangeQuery(field.getName(), low, high, minInclusive, maxInclusive);
  }
}
 
Example 18
Source Project: lucene-solr   Source File: DateRangeField.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected SpatialArgs parseSpatialArgs(QParser parser, String externalVal) {
  //We avoid SpatialArgsParser entirely because it isn't very Solr-friendly
  final Shape shape = parseShape(externalVal);
  final SolrParams localParams = parser.getLocalParams();
  SpatialOperation op = SpatialOperation.Intersects;
  if (localParams != null) {
    String opStr = localParams.get(OP_PARAM);
    if (opStr != null)
      op = SpatialOperation.get(opStr);
  }
  return new SpatialArgs(op, shape);
}
 
Example 19
Source Project: lucene-solr   Source File: SolrQueryParserBase.java    License: Apache License 2.0 5 votes vote down vote up
protected Query getLocalParams(String qfield, String lparams) throws SyntaxError {
  if (!allowSubQueryParsing) {
    throw new SyntaxError("local-params subquery is disabled");
  }
  QParser nested = parser.subQuery(lparams, null);
  return nested.getQuery();
}
 
Example 20
Source Project: querqy   Source File: DismaxSearchEngineRequestAdapter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Query parseRawQuery(final RawQuery rawQuery) throws SyntaxException {
    try {

        if (rawQuery instanceof StringRawQuery) {
            return QParser.getParser(((StringRawQuery) rawQuery).getQueryString(),
                    null, request).getQuery();
        } else {
            throw new UnsupportedOperationException("Implementation type of RawQuery is not supported for this adapter");
        }

    } catch (SyntaxError syntaxError) {
        throw new SyntaxException(syntaxError);
    }
}
 
Example 21
Source Project: lucene-solr   Source File: TextField.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Query getSpecializedRangeQuery(QParser parser, SchemaField field, String part1, String part2, boolean minInclusive, boolean maxInclusive) {
  Analyzer multiAnalyzer = getMultiTermAnalyzer();
  BytesRef lower = analyzeMultiTerm(field.getName(), part1, multiAnalyzer);
  BytesRef upper = analyzeMultiTerm(field.getName(), part2, multiAnalyzer);
  return new SolrRangeQuery(field.getName(), lower, upper, minInclusive, maxInclusive);
}
 
Example 22
Source Project: lucene-solr   Source File: ChildDocTransformerFactory.java    License: Apache License 2.0 5 votes vote down vote up
private static Query parseQuery(String qstr, SolrQueryRequest req, String param) {
  try {
    return QParser.getParser(qstr, req).getQuery();
  } catch (SyntaxError syntaxError) {
    throw new SolrException(ErrorCode.BAD_REQUEST, "Failed to parse '" + param + "' param.");
  }
}
 
Example 23
Source Project: lucene-solr   Source File: FacetProcessor.java    License: Apache License 2.0 5 votes vote down vote up
private static Query parserFilter(String rawFilter, SolrQueryRequest req) {
  QParser parser = null;
  try {
    parser = QParser.getParser(rawFilter, req);
    parser.setIsFilter(true);
    Query symbolicFilter = parser.getQuery();
    if (symbolicFilter == null) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
          "QParser yields null, perhaps unresolved parameter reference in: "+rawFilter);
    }
    return symbolicFilter;
  } catch (SyntaxError syntaxError) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, syntaxError);
  }
}
 
Example 24
Source Project: lucene-solr   Source File: LongPointField.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Query getSetQuery(QParser parser, SchemaField field, Collection<String> externalVal) {
  assert externalVal.size() > 0;
  if (!field.indexed()) {
    return super.getSetQuery(parser, field, externalVal);
  }
  long[] values = new long[externalVal.size()];
  int i = 0;
  for (String val:externalVal) {
    values[i] = parseLongFromUser(field.getName(), val);
    i++;
  }
  return LongPoint.newSetQuery(field.getName(), values);
}
 
Example 25
Source Project: lucene-solr   Source File: FieldUtil.java    License: Apache License 2.0 5 votes vote down vote up
public static SortedDocValues getSortedDocValues(QueryContext context, SchemaField field, QParser qparser) throws IOException {
  SortedDocValues si = context.searcher().getSlowAtomicReader().getSortedDocValues( field.getName() );
  // if (!field.hasDocValues() && (field.getType() instanceof StrField || field.getType() instanceof TextField)) {
  // }

  return si == null ? DocValues.emptySorted() : si;
}
 
Example 26
Source Project: lucene-solr   Source File: AbstractSpatialFieldType.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Query getSpecializedRangeQuery(QParser parser, SchemaField field, String part1, String part2, boolean minInclusive, boolean maxInclusive) {
  if (!minInclusive || !maxInclusive)
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Both sides of spatial range query must be inclusive: " + field.getName());
  Point p1 = SpatialUtils.parsePointSolrException(part1, ctx);
  Point p2 = SpatialUtils.parsePointSolrException(part2, ctx);

  Rectangle bbox = ctx.makeRectangle(p1, p2);
  SpatialArgs spatialArgs = new SpatialArgs(SpatialOperation.Intersects, bbox);
  return getQueryFromSpatialArgs(parser, field, spatialArgs);//won't score by default
}
 
Example 27
Source Project: lucene-solr   Source File: RelatednessAgg.java    License: Apache License 2.0 5 votes vote down vote up
public void setOpts(QParser parser) {
  final boolean isShard = parser.getReq().getParams().getBool(ShardParams.IS_SHARD, false);
  SolrParams opts = parser.getLocalParams();
  if (null != opts) {
    if (!isShard) { // ignore min_pop if this is a shard request
      this.min_pop = opts.getDouble("min_popularity", 0.0D);
    }
  }
}
 
Example 28
Source Project: querqy   Source File: DefaultQuerqyDismaxQParserPlugin.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public QParser createParser(final String qstr, final SolrParams localParams, final SolrParams params,
                            final SolrQueryRequest req, final InfoLogging infoLogging,
                            final TermQueryCache termQueryCache) {
      return new QuerqyDismaxQParser(qstr, localParams, params, req,
              createQuerqyParser(qstr, localParams, params, req), rewriteChain, infoLogging, termQueryCache);
}
 
Example 29
Source Project: lucene-solr   Source File: AbstractSpatialFieldType.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ValueSource getValueSource(SchemaField field, QParser parser) {
  //This is different from Solr 3 LatLonType's approach which uses the MultiValueSource concept to directly expose
  // the x & y pair of FieldCache value sources.
  throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
      "A ValueSource isn't directly available from this field. Instead try a query using the distance as the score.");
}
 
Example 30
Source Project: BioSolr   Source File: TestXJoinQParserPlugin.java    License: Apache License 2.0 5 votes vote down vote up
private static Query parse(String v) throws SyntaxError {
  ModifiableSolrParams localParams = new ModifiableSolrParams();
  localParams.add(QueryParsing.V, v);
  QParserPlugin qpp = core.getQueryPlugin(PARSER_NAME);
  QParser qp = qpp.createParser(null, localParams, null, req);
  return qp.parse();
}