Example usage for org.apache.solr.search SolrIndexSearcher GET_DOCLIST

List of usage examples for org.apache.solr.search SolrIndexSearcher GET_DOCLIST

Introduction

In this page you can find the example usage for org.apache.solr.search SolrIndexSearcher GET_DOCLIST.

Prototype

int GET_DOCLIST

To view the source code for org.apache.solr.search SolrIndexSearcher GET_DOCLIST.

Click Source Link

Usage

From source file:geocluster.GeoclusterComponent.java

License:Apache License

@Override
public void prepare(ResponseBuilder rb) throws IOException {
    SolrParams params = rb.req.getParams();
    if (params.getBool(COMPONENT_NAME, false)) {
        // We rely on a docList to access data to cluster upon.
        // TODO: this just doesn't work
        // rb.setNeedDocList( true );
        // Alternative workaround, see getDocList in Grouping.java
        rb.setFieldFlags(SolrIndexSearcher.GET_DOCLIST);

        this.initialized = false;
        try {//from w  w  w  .  j  ava2  s.c o  m
            // Parse geocluster specific query parameters.
            // These are provided by GeoclusterSearchApiSolrService.
            this.clusterDistance = Double.parseDouble(params.get("geocluster.clusterDistance"));
            this.zoomLevel = Integer.parseInt(params.get("geocluster.zoomLevel"));
            this.resolution = Double.parseDouble(params.get("geocluster.resolution"));
            this.geohashLength = Integer.parseInt(params.get("geocluster.geohashLength"));
            this.clusterField = params.get("geocluster.clusterField");
            this.groupField = params.get("geocluster.groupField");
            this.geohashField = params.get("geocluster.geohashField");
            this.idField = params.get("geocluster.idField");
            this.latlonField = params.get("geocluster.latlonField");
            this.initialized = true;
        } catch (Exception e) {
        }
    }

    this.clusterDistance = 200;
}