org.apache.solr.core

## Class QuerySenderListener

- java.lang.Object
- - org.apache.solr.core.AbstractSolrEventListener
  - - org.apache.solr.core.QuerySenderListener

- All Implemented Interfaces:
    SolrEventListener, NamedListInitializedPlugin

      public class QuerySenderListener
      extends AbstractSolrEventListener

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QuerySenderListener(SolrCore core)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher)` The searchers passed here are only guaranteed to be valid for the duration of this method call, so care should be taken not to spawn threads or asynchronous tasks with references to these searchers.

    - ### Methods inherited from class org.apache.solr.core.AbstractSolrEventListener

      `addEventParms, getArgs, getCore, init, postCommit, postSoftCommit, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### QuerySenderListener

          public QuerySenderListener(SolrCore core)

  - ### Method Detail

    - #### newSearcher

          public void newSearcher(SolrIndexSearcher newSearcher,
                                  SolrIndexSearcher currentSearcher)

      Description copied from interface: `SolrEventListener`
      The searchers passed here are only guaranteed to be valid for the duration of this method call, so care should be taken not to spawn threads or asynchronous tasks with references to these searchers.

      Implementations should add the `EventParams.EVENT` parameter and set it to a value of either:

      - `EventParams.FIRST_SEARCHER` - First Searcher event
      - `EventParams.NEW_SEARCHER` - New Searcher event
      Sample:

              if (currentSearcher != null) {
                nlst.add(CommonParams.EVENT, CommonParams.NEW_SEARCHER);
              } else {
                nlst.add(CommonParams.EVENT, CommonParams.FIRST_SEARCHER);
              }

      Specified by:
        `newSearcher` in interface `SolrEventListener`
      Overrides:
        `newSearcher` in class `AbstractSolrEventListener`
      Parameters:
        `newSearcher` - The new `SolrIndexSearcher` to use
        `currentSearcher` - The existing `SolrIndexSearcher`. null if this is a firstSearcher event.
      See Also:
        `AbstractSolrEventListener.addEventParms(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.common.util.NamedList)`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.