Example usage for org.apache.solr.core SolrCore getSearchComponents

List of usage examples for org.apache.solr.core SolrCore getSearchComponents

Introduction

In this page you can find the example usage for org.apache.solr.core SolrCore getSearchComponents.

Prototype

public PluginBag<SearchComponent> getSearchComponents() 

Source Link

Document

Accessor for all the Search Components

Usage

From source file:org.ezsystems.solr.handler.ezfind.eZFindRequestHandler.java

License:Open Source License

public void inform(SolrCore core) {
    this.core = core;

    Map<String, SearchComponent> availableSearchComponents = core.getSearchComponents();

    for (Iterator i = availableSearchComponents.entrySet().iterator(); i.hasNext();) {
        Map.Entry e = (Map.Entry) i.next();
        // Ugly hard-coded fully-qualified class name. Any workaround ?
        if (e.getValue().getClass().getName() == "org.apache.solr.handler.component.QueryElevationComponent") {
            // Found the Query Elevation Component, store it as local property.
            this.elevationComponent = (QueryElevationComponent) e.getValue();
            break;
        }/*from   w  ww .  j a  v a2 s  .  c o m*/
    }
}