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:23:58 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=7&rev2=8

  
  ----
  === 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 (or for all the rows that a previous Transformer that creates multiple rows from the original
one), then there are two cases.
+ Let {{{TS = {t«0», t«1», t«2», ..., t«n»} }}}be 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 (or for all the rows that a previous Transformer that creates
multiple rows from the original one), 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 no transformer {{{t«k»}}}, with {{{k < i}}}, returns a {{{java.util.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, an t«i» returns null for all those recently created rows, then a java.lang.!IndexOutBoundsException
will be thrown.
+ If there is a transformer {{{t«k»}}}, with {{{k < i}}}, that returns a {{{java.util.List}}}
of rows for that particular row, and {{{t«i»}}} returns {{{null}}} for all those recently
created rows, then a {{{ java.lang.IndexOutBoundsException }}} will be thrown.
  
- Now, if at any time a transformRow call returns an empty List, a java.lang.!IndexOutBoundsException
will be thrown.
+ Now, if at any time a transformRow call returns an empty {{{java.util.List}}}, a {{{ java.lang.IndexOutBoundsException
}}} will be thrown. So you should never return an empty {{{java.util.List}}}.
  ----
  == 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