lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "DIHCustomTransformer" by GustavoMunoz
Date Sat, 19 Nov 2011 00:10:44 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "DIHCustomTransformer" page has been changed by GustavoMunoz:
http://wiki.apache.org/solr/DIHCustomTransformer?action=diff&rev1=4&rev2=5

  	}
  }
  }}}
- No need to extend any class. Just write any class which has a method named transformRow
with the above signature and DataImportHandler will instantiate it and call the transformRow
method using reflection.
+ No need to extend any class. Just write any class which has a method named transformRow
with the above signature and DataImportHandler will instantiate it and call the transformRow
method using reflection. 
+ 
  But of course you may extend the abstract class org.apache.solr.handler.dataimport.Transformer.
   You will specify it in your data-config.xml as follows:
  {{{
@@ -25, +26 @@

  </entity>
  }}}
  
+ ----
+ === What about returning values like null or an empty List? ===
+ Let TS = {t«0», t«1», t«2», ..., t«n»} is the transformer (ordered) list configured
for a particular entity and say t«i», with i <= n and i >= 0, returns null for a particular
row, then there are two cases.
+ If no transformer t«k», with k < i, returns a List of rows, then that particular row
is ignored, that means, it won't be inserted, deleted or updated. Additionally no transformer
t«j», with j > i, will be invoked.
+ If there is a transformer t«k», with k < i, that returns a List of rows for that particular
row, then a !java.lang.IndexOutBoundsException will be thrown.
+ 
+ Now, if transformRow returns an empty List then also a !java.lang.IndexOutBoundsException
will be thrown
+ ----
  == A General TrimTransformer ==
  Suppose you want to write a general !TrimTransformer without hardcoding the column on which
it needs to operate. Now we'd need to have a flag on the field in data-config.xml to indicate
that the !TrimTransformer should apply itself on this field.
  {{{

Mime
View raw message