com.googlecode.fascinator.indexer.rules
Class AddField

java.lang.Object
  extended by com.googlecode.fascinator.api.indexer.rule.Rule
      extended by com.googlecode.fascinator.indexer.rules.AddField

public class AddField
extends Rule

Adds a single field to a Solr document

Author:
Oliver Lucido

Constructor Summary
AddField(String fieldName)
          Creates a rule to add a field with no initial value
AddField(String fieldName, String value)
          Creates a rule to add a field with the specified name and initial value
 
Method Summary
 void run(Reader in, Writer out)
          Adds a single field to a Solr document
 void setValue(String value)
          Sets the value of the field
 
Methods inherited from class com.googlecode.fascinator.api.indexer.rule.Rule
getLog, getName, isRequired, log, log, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddField

public AddField(String fieldName)
Creates a rule to add a field with no initial value

Parameters:
fieldName - Field name

AddField

public AddField(String fieldName,
                String value)
Creates a rule to add a field with the specified name and initial value

Parameters:
fieldName - Field name
value - Field value
Method Detail

setValue

public void setValue(String value)
Sets the value of the field

Parameters:
value - Field value

run

public void run(Reader in,
                Writer out)
         throws RuleException
Adds a single field to a Solr document

Specified by:
run in class Rule
Parameters:
in - Solr document
out - Solr document with added field
Throws:
RuleException


Copyright © 2009-2012. All Rights Reserved.