~slub.team/goobi-indexserver/3.x

« back to all changes in this revision

Viewing changes to solr/core/src/java/org/apache/solr/core/SolrEventListener.java

  • Committer: Sebastian Meyer
  • Date: 2012-08-03 09:12:40 UTC
  • Revision ID: sebastian.meyer@slub-dresden.de-20120803091240-x6861b0vabq1xror
Remove Lucene and Solr source code and add patches instead
Fix Bug #985487: Auto-suggestion for the search interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 
 * contributor license agreements.  See the NOTICE file distributed with
4
 
 * this work for additional information regarding copyright ownership.
5
 
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 
 * (the "License"); you may not use this file except in compliance with
7
 
 * the License.  You may obtain a copy of the License at
8
 
 *
9
 
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 
 *
11
 
 * Unless required by applicable law or agreed to in writing, software
12
 
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 
 * See the License for the specific language governing permissions and
15
 
 * limitations under the License.
16
 
 */
17
 
 
18
 
package org.apache.solr.core;
19
 
 
20
 
import org.apache.solr.search.SolrIndexSearcher;
21
 
import org.apache.solr.util.plugin.NamedListInitializedPlugin;
22
 
 
23
 
import org.slf4j.Logger;
24
 
import org.slf4j.LoggerFactory;
25
 
 
26
 
/**
27
 
 * @version $Id: SolrEventListener.java 1052938 2010-12-26 20:21:48Z rmuir $
28
 
 */
29
 
public interface SolrEventListener extends NamedListInitializedPlugin{
30
 
  static final Logger log = LoggerFactory.getLogger(SolrCore.class);
31
 
 
32
 
 
33
 
  public void postCommit();
34
 
 
35
 
  /** The searchers passed here are only guaranteed to be valid for the duration
36
 
   * of this method call, so care should be taken not to spawn threads or asynchronous
37
 
   * tasks with references to these searchers.
38
 
   * <p/>
39
 
   * Implementations should add the {@link org.apache.solr.common.params.EventParams#EVENT} parameter and set it to a value of either:
40
 
   * <ul>
41
 
   * <li>{@link org.apache.solr.common.params.EventParams#FIRST_SEARCHER} - First Searcher event</li>
42
 
   * <li>{@link org.apache.solr.common.params.EventParams#NEW_SEARCHER} - New Searcher event</li>
43
 
   * </ul>
44
 
   *
45
 
   * Sample:
46
 
   * <pre>
47
 
    if (currentSearcher != null) {
48
 
      nlst.add(CommonParams.EVENT, CommonParams.NEW_SEARCHER);
49
 
    } else {
50
 
      nlst.add(CommonParams.EVENT, CommonParams.FIRST_SEARCHER);
51
 
    }
52
 
   *
53
 
   * </pre>
54
 
   *
55
 
   * @see org.apache.solr.core.AbstractSolrEventListener#addEventParms(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.common.util.NamedList) 
56
 
   *
57
 
   * @param newSearcher The new {@link org.apache.solr.search.SolrIndexSearcher} to use
58
 
   * @param currentSearcher The existing {@link org.apache.solr.search.SolrIndexSearcher}.  null if this is a firstSearcher event.
59
 
   *
60
 
   */
61
 
  public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher);
62
 
 
63
 
}