lux.index.field
Class XPathField<T>

java.lang.Object
  extended by lux.index.field.FieldDefinition
      extended by lux.index.field.XPathField<T>
Type Parameters:
T - the type of value stored in or indexed by the field; must correspond with the FieldDefinition.Type: STRING => String, and INT => Integer

public class XPathField<T>
extends FieldDefinition

Indexes the values of the XPath expression evaluated with the document as the context item


Nested Class Summary
 
Nested classes/interfaces inherited from class lux.index.field.FieldDefinition
FieldDefinition.Type
 
Constructor Summary
XPathField(String name, String xpath, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.document.Field.Store isStored, FieldDefinition.Type type)
          create a new indexed field whose values are given by evaluating an XPath expression
 
Method Summary
 Iterable<T> getValues(XmlIndexer indexer)
          The Solr XmlUpdateProcessor calls this.
 
Methods inherited from class lux.index.field.FieldDefinition
getAnalyzer, getDefaultName, getFieldValues, getSolrFieldProperties, getType, isRenameable, isSingleValued, isStored, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XPathField

public XPathField(String name,
                  String xpath,
                  org.apache.lucene.analysis.Analyzer analyzer,
                  org.apache.lucene.document.Field.Store isStored,
                  FieldDefinition.Type type)
create a new indexed field whose values are given by evaluating an XPath expression

Parameters:
name - the name of the field; although Lucene naming conventions are fairly loose, it will go easier if you restrict yourself to [A-Za-z0-9_.-]
xpath - the xpath to evaluate
analyzer - String-valued fields may be subject to further textual analysis, or pass null if the field is not to be analyzed.
isStored - whether the field values are stored (and may be retrieved)
type - the type of data indexed by the field
Method Detail

getValues

public Iterable<T> getValues(XmlIndexer indexer)
Description copied from class: FieldDefinition
The Solr XmlUpdateProcessor calls this. If it returns null, the caller should use the values from getFieldValues() instead.

Overrides:
getValues in class FieldDefinition
Parameters:
indexer - the indexer that holds the field values
Returns:
the accumulated values of the field, as primitive objects (String or Integer). If


Copyright © 2013. All Rights Reserved.