Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.apache.solr.update.processor;
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
Identifies the language of a set of input fields using Tika's LanguageIdentifier. The tika-core-x.y.jar must be on the classpath

The UpdateProcessorChain config entry can take a number of parameters which may also be passed as HTTP parameters on the update request and override the defaults. Here is the simplest processor config possible:

 <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
   <str name="langid.fl">title,text</str>
   <str name="langid.langField">language_s</str>

  protected SolrParams defaults;
  protected SolrParams appends;
  protected SolrParams invariants;
  public void inform(SolrCore core) {

The UpdateRequestProcessor may be initialized in solrconfig.xml similarly to a RequestHandler, with defaults, appends and invariants.

args a NamedList with the configuration parameters
  public void initNamedList args )
    if (args != null) {
      Object o;
      o = args.get("defaults");
      if (o != null && o instanceof NamedList) {
         = SolrParams.toSolrParams((NamedListo);
      } else {
         = SolrParams.toSolrParams(args);
      o = args.get("appends");
      if (o != null && o instanceof NamedList) {
         = SolrParams.toSolrParams((NamedListo);
      o = args.get("invariants");
      if (o != null && o instanceof NamedList) {
         = SolrParams.toSolrParams((NamedListo);
                                            SolrQueryResponse rspUpdateRequestProcessor next) {
    // Process defaults, appends and invariants if we got a request
    if(req != null) {
    return new TikaLanguageIdentifierUpdateProcessor(reqrspnext);
New to GrepCode? Check out our FAQ X