Wednesday, August 07, 2013

Added some update processor scripts to EAR#5 for Solr 4.x Deep Dive

I was going to take a day off to get some perspective on the next phase of the book, but instead I saw several questions on the Solr email list that begged for solution using update processors. So, I added them as examples:
  1. Round a decimal number. I added a JavaScript script for the StatelessScriptUpdate processor which takes an input field, a number of decimal digits (default is zero), an output field (defaults to replacing the input field), and an optional flag for whether the rounded decimal number should have its type changed to integer (default is to stay as a float decimal.) Handles multivalued fields.
  2. Append a field onto another field. This is just a use of the Clone and Concat update processors, using various delimiters. Also an example that uses the Ignore Field update processor to remove the source field after it has been appended.
  3. Map country code to continent code. This JavaScript script for the StatelessScriptUpdate processor can do the mapping in-place or output to another field. Option for case of output string (default is lower case). Handles multivalued fields. Unmappable input values are preserved as-is
Okay, now I can get back to deciding whether to tackle highlighting next. I think that at a minimum I will take a stab at it for a couple of days, see how far I can get before getting too bogged down in the more confusing aspects, and then reconsider what to focus on next for EAR#5, which is still scheduled for publication on Friday, August 16, 2013.
-- Jack Krupansky


Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home