org.skife.lucene.graph
Class GraphIndexer

java.lang.Object
  extended byorg.skife.lucene.graph.GraphIndexer

public class GraphIndexer
extends java.lang.Object

Facility which provides for creating indexes on graphs of persistent objects


Constructor Summary
GraphIndexer()
          No metadata, StandardLibraryFilter applied to objects traversed, visits all object and collection references, uses the base name of the class (SimpleNameMapper, lower cased, for root names, uses SimpleValueMapper for values, and uses the Lucene StandardAnalyzer to build the index
GraphIndexer(MetadataFactory metadata)
          Provides the same behavior as the GraphIndexer() constructor except provides for metadata
GraphIndexer(MetadataFactory metadata, ObjectIndexFilter filter)
          Provides the same behavior as the GraphIndexer() constructor except provides for metadata and filtering which objects are indexed
GraphIndexer(org.apache.commons.grafolia.graph.WalkerFactory walkerFactory, MetadataFactory metadata, org.apache.lucene.analysis.Analyzer analyzer, ObjectIndexFilter filter, NameMapper nameMapper, ValueMapper valueMapper)
          Fully specify the behavior of the GraphIndexer
 
Method Summary
 java.io.File index(java.io.File index, java.lang.Object root)
          Creates a relation-aware index for everything referenced under root
 java.io.File index(java.lang.Object root)
          Creates a relation-aware index for everything referenced under root
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphIndexer

public GraphIndexer()
No metadata, StandardLibraryFilter applied to objects traversed, visits all object and collection references, uses the base name of the class (SimpleNameMapper, lower cased, for root names, uses SimpleValueMapper for values, and uses the Lucene StandardAnalyzer to build the index


GraphIndexer

public GraphIndexer(MetadataFactory metadata)
Provides the same behavior as the GraphIndexer() constructor except provides for metadata


GraphIndexer

public GraphIndexer(MetadataFactory metadata,
                    ObjectIndexFilter filter)
Provides the same behavior as the GraphIndexer() constructor except provides for metadata and filtering which objects are indexed


GraphIndexer

public GraphIndexer(org.apache.commons.grafolia.graph.WalkerFactory walkerFactory,
                    MetadataFactory metadata,
                    org.apache.lucene.analysis.Analyzer analyzer,
                    ObjectIndexFilter filter,
                    NameMapper nameMapper,
                    ValueMapper valueMapper)
Fully specify the behavior of the GraphIndexer

Parameters:
walkerFactory - A Grafolia WalkerFactory which controls the traversal of the object graph
metadata - Specify metadata on a per-instance basis
analyzer - Use a a non-standard Lucene indexer
filter - Filter which instances are indexed
nameMapper - Specify names for roots of search chains
valueMapper - Specify how the values for fields in the filter are generated
Method Detail

index

public java.io.File index(java.lang.Object root)
                   throws java.io.IOException
Creates a relation-aware index for everything referenced under root

Will create a temporary file to store the index

Parameters:
root - root of graph to be indexed, can be a collection
Returns:
file where index is created
Throws:
java.io.IOException

index

public java.io.File index(java.io.File index,
                          java.lang.Object root)
                   throws java.io.IOException
Creates a relation-aware index for everything referenced under root

Parameters:
index - Add to an already created index. Must have been previously created
root - root of graph to be indexed, can be a collection
Throws:
java.io.IOException


Copyright © 2004 Brian McCallister. All Rights Reserved.