org.apache.lucene.index
Class LuceneSubIndexInfo

java.lang.Object
  extended by org.apache.lucene.index.LuceneSubIndexInfo

public class LuceneSubIndexInfo
extends Object

Provides information about the segments within a Lucene index and about the lucene index itself.

Can not be instantiated directly, but has a factory method (getSegmentsInfos) which returns the index info for the given index path.

Author:
kimchy

Nested Class Summary
static class LuceneSubIndexInfo.LuceneSegmentInfo
          A Lucene single segment information
 
Constructor Summary
protected LuceneSubIndexInfo(String subIndex, long version, ArrayList segmentInfos)
           
 
Method Summary
static LuceneSubIndexInfo getIndexInfo(String subIndex, CompassSession session)
          Returns low level Lucene index sub index information.
static LuceneSubIndexInfo getIndexInfo(String subIndex, LuceneSearchEngineIndexManager indexManager)
           
static LuceneSubIndexInfo getIndexInfo(String subIndex, LuceneSearchEngineStore store)
          Returns low level Lucene index sub index information.
 String getSubIndex()
          The index parh of the given index.
 LuceneSubIndexInfo.LuceneSegmentInfo info(int segmentIndex)
          The segment info that maps to the given index.
 int size()
          Retruns the number of segments.
 long version()
          Returns the version of the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneSubIndexInfo

protected LuceneSubIndexInfo(String subIndex,
                             long version,
                             ArrayList segmentInfos)
Method Detail

version

public long version()
Returns the version of the index.

Returns:
The version of the index

size

public int size()
Retruns the number of segments.

Returns:
The number of segments

info

public LuceneSubIndexInfo.LuceneSegmentInfo info(int segmentIndex)
The segment info that maps to the given index.

Parameters:
segmentIndex - The segment index
Returns:
The segment info structure

getSubIndex

public String getSubIndex()
The index parh of the given index.

Returns:
The index path

getIndexInfo

public static LuceneSubIndexInfo getIndexInfo(String subIndex,
                                              CompassSession session)
                                       throws IOException
Returns low level Lucene index sub index information. Note, this method can be called outside of a transactional context.

Parameters:
subIndex - The sub index to get the info for
session - The compass session that will be used for transactional support
Returns:
The sub index info
Throws:
IOException - Failed to read the segments from the directory

getIndexInfo

public static LuceneSubIndexInfo getIndexInfo(String subIndex,
                                              LuceneSearchEngineIndexManager indexManager)
                                       throws IOException
Throws:
IOException

getIndexInfo

public static LuceneSubIndexInfo getIndexInfo(String subIndex,
                                              LuceneSearchEngineStore store)
                                       throws IOException
Returns low level Lucene index sub index information. Note, this method must be called within a transactional context.

Throws:
IOException


Copyright (c) 2004-2008 The Compass Project.