org.apache.lucene.index

Class MultiReader

public class MultiReader extends IndexReader

An IndexReader which reads multiple indexes, appending their content.

Version: $Id: MultiReader.java,v 1.7 2004/05/17 12:56:47 goller Exp $

Constructor Summary
MultiReader(IndexReader[] subReaders)

Construct a MultiReader aggregating the named set of (sub)readers.

Method Summary
intdocFreq(Term t)
Documentdocument(int n)
protected voiddoClose()
protected voiddoCommit()
protected voiddoDelete(int n)
protected voiddoSetNorm(int n, String field, byte value)
protected voiddoUndeleteAll()
CollectiongetFieldNames()
CollectiongetFieldNames(boolean indexed)
CollectiongetIndexedFieldNames(boolean storedTermVector)
TermFreqVectorgetTermFreqVector(int n, String field)
TermFreqVector[]getTermFreqVectors(int n)
Return an array of term frequency vectors for the specified document.
booleanhasDeletions()
booleanisDeleted(int n)
intmaxDoc()
byte[]norms(String field)
voidnorms(String field, byte[] result, int offset)
intnumDocs()
TermDocstermDocs()
TermPositionstermPositions()
TermEnumterms()
TermEnumterms(Term term)

Constructor Detail

MultiReader

public MultiReader(IndexReader[] subReaders)

Construct a MultiReader aggregating the named set of (sub)readers. Directory locking for delete, undeleteAll, and setNorm operations is left to the subreaders.

Note that all subreaders are closed if this Multireader is closed.

Parameters: subReaders set of (sub)readers

Throws: IOException

Method Detail

docFreq

public int docFreq(Term t)

document

public Document document(int n)

doClose

protected void doClose()

doCommit

protected void doCommit()

doDelete

protected void doDelete(int n)

doSetNorm

protected void doSetNorm(int n, String field, byte value)

doUndeleteAll

protected void doUndeleteAll()

getFieldNames

public Collection getFieldNames()

See Also: getFieldNames

getFieldNames

public Collection getFieldNames(boolean indexed)

See Also: IndexReader

getIndexedFieldNames

public Collection getIndexedFieldNames(boolean storedTermVector)

getTermFreqVector

public TermFreqVector getTermFreqVector(int n, String field)

getTermFreqVectors

public TermFreqVector[] getTermFreqVectors(int n)
Return an array of term frequency vectors for the specified document. The array contains a vector for each vectorized field in the document. Each vector vector contains term numbers and frequencies for all terms in a given vectorized field. If no such fields existed, the method returns null.

hasDeletions

public boolean hasDeletions()

isDeleted

public boolean isDeleted(int n)

maxDoc

public int maxDoc()

norms

public byte[] norms(String field)

norms

public void norms(String field, byte[] result, int offset)

numDocs

public int numDocs()

termDocs

public TermDocs termDocs()

termPositions

public TermPositions termPositions()

terms

public TermEnum terms()

terms

public TermEnum terms(Term term)
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.