org.apache.solr.handler.dataimport
Class Transformer

java.lang.Object
  extended by org.apache.solr.handler.dataimport.Transformer
Direct Known Subclasses:
ClobTransformer, DateFormatTransformer, HTMLStripTransformer, LogTransformer, NumberFormatTransformer, RegexTransformer, ScriptTransformer, TemplateTransformer

public abstract class Transformer
extends Object

Use this API to implement a custom transformer for any given entity

Implementations of this abstract class must provide a public no-args constructor.

Refer to http://wiki.apache.org/solr/DataImportHandler for more details.

This API is experimental and may change in the future.

Since:
solr 1.3

Constructor Summary
Transformer()
           
 
Method Summary
abstract  Object transformRow(Map<String,Object> row, Context context)
          The input is a row of data and the output has to be a new row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformer

public Transformer()
Method Detail

transformRow

public abstract Object transformRow(Map<String,Object> row,
                                    Context context)
The input is a row of data and the output has to be a new row.

Parameters:
context - The current context
row - A row of data
Returns:
The changed data. It must be a Map<String, Object> if it returns only one row or if there are multiple rows to be returned it must be a List<Map<String, Object>>


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