Xindice API
version 1.2m1

org.apache.xindice.core.indexer
Interface Indexer

All Superinterfaces:
Configurable, DBObject, Named
All Known Implementing Classes:
LuceneIndexer, MemValueIndexer, NameIndexer, ValueIndexer

public interface Indexer
extends Named, DBObject, Configurable

Indexer is the abstract indexing interface for Xindice. An Indexer object is implemented in order to retrieve and manage indexes.

Any number of Indexer instances may be associated with a single Collection. The type of Indexer utilized by a query depends on the 'Style' of Indexer and the type of QueryResolver that is being used to performt he query. Currently, Xindice only internally supports one kind of Indexer: 'XPath'.

Version:
$Revision: 564424 $, $Date: 2007-08-09 19:40:03 -0400 (Thu, 09 Aug 2007) $

Field Summary
static String STYLE_FULLTEXT
           
static String STYLE_NODENAME
           
static String STYLE_NODEVALUE
           
 
Method Summary
 void flush()
          flush forcefully flushes any unwritten buffers to disk.
 IndexerEventHandler getIndexerEventHandler()
          getIndexerEventHandler returns an instance of IndexerEventHandler that handles Indexer-specific events.
 String getIndexStyle()
          getIndexStyle returns the Index style.
 IndexPattern[] getPatterns()
          getPatterns returns the patterns recognized by this Indexer.
 IndexMatch[] queryMatches(IndexQuery query)
          queryMatches retrieves a set of IndexMatch instances that match the supplied query.
 void setCollection(Collection collection)
          setCollection tells the Indexer who its parent is.
 
Methods inherited from interface org.apache.xindice.util.Named
getName
 
Methods inherited from interface org.apache.xindice.core.DBObject
close, create, drop, exists, isOpened, open
 
Methods inherited from interface org.apache.xindice.util.Configurable
getConfig, setConfig
 

Field Detail

STYLE_NODENAME

public static final String STYLE_NODENAME
See Also:
Constant Field Values

STYLE_NODEVALUE

public static final String STYLE_NODEVALUE
See Also:
Constant Field Values

STYLE_FULLTEXT

public static final String STYLE_FULLTEXT
See Also:
Constant Field Values
Method Detail

setCollection

public void setCollection(Collection collection)
setCollection tells the Indexer who its parent is.

Parameters:
collection - The owner Collection

getIndexStyle

public String getIndexStyle()
getIndexStyle returns the Index style. Different query languages will need to draw from different indexing styles. For example, A query that is written in quilt will require XPath indexing.

Returns:
The index style

getPatterns

public IndexPattern[] getPatterns()
getPatterns returns the patterns recognized by this Indexer. Patterns must be in the form of (elem|*)[@(attr|*)] to tell the IndexManager which element types to send to it, so for example:
    contact@name  Indexes all contacts by name attribute
    memo          Indexes the text of all memo elements
    contact@*     Indexes all contact attributes
    *@name        Indexes the name attribute for all elements
    *             Indexes the text of all elements
    *@*           Indexes all attributes of all elements
 
These patterns are used by the IndexManager when handling SAX events. All events that match the any of specified patterns will result in an call to the Indexer's event handler.

Returns:
The Patterns used

queryMatches

public IndexMatch[] queryMatches(IndexQuery query)
                          throws DBException
queryMatches retrieves a set of IndexMatch instances that match the supplied query. The matches are then used by the QueryEngine in co-sequential processing. If this indexer doesn't support the passed value, it should return 'null'. If no matches are found, it should return an empty set. queryMatches will typically be used in XPath processing.

Parameters:
query - The IndexQuery to use
Returns:
The resulting matches
Throws:
DBException

flush

public void flush()
           throws DBException
flush forcefully flushes any unwritten buffers to disk.

Throws:
DBException

getIndexerEventHandler

public IndexerEventHandler getIndexerEventHandler()
getIndexerEventHandler returns an instance of IndexerEventHandler that handles Indexer-specific events. This method is called once per document, and all events for one document will be processed by the same handler.

Returns:
IndexerEventHandler that will handle document processing
See Also:
IndexerEventHandler

Xindice API
version 1.2m1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.