Example usage for org.apache.solr.common.params ModifiableSolrParams getParameterNames

List of usage examples for org.apache.solr.common.params ModifiableSolrParams getParameterNames

Introduction

In this page you can find the example usage for org.apache.solr.common.params ModifiableSolrParams getParameterNames.

Prototype

public Set<String> getParameterNames() 

Source Link

Usage

From source file:org.alfresco.solr.component.RewriteFacetParametersComponent.java

License:Open Source License

@Override
public void prepare(ResponseBuilder rb) throws IOException {
    SolrQueryRequest req = rb.req;/*  w  ww .j  a v a  2s .co  m*/
    SolrParams params = req.getParams();

    ModifiableSolrParams fixed = new ModifiableSolrParams();
    ModifiableSolrParams allParamsWithFix = new ModifiableSolrParams(params);
    fixFilterQueries(fixed, params, rb);
    fixFacetParams(fixed, params, rb);
    fixRows(fixed, params, rb);

    Set<String> fixedParameterNames = fixed.getParameterNames();
    for (String fixedParam : fixedParameterNames) {
        allParamsWithFix.set(fixedParam, fixed.getParams(fixedParam));
    }

    if (allParamsWithFix.get(CommonParams.SORT) != null) {
        allParamsWithFix.remove(CommonParams.RQ);
    }

    req.setParams(allParamsWithFix);
}