Logo Search packages:      
Sourcecode: qt4-x11 version File versions

IndexReader Class Reference

#include <IndexReader.h>

Inheritance diagram for IndexReader:


List of all members.

Detailed Description

IndexReader is an abstract class, providing an interface for accessing an index. Search of an index is done entirely through this abstract interface, so that any subclass which implements it is searchable.

Concrete subclasses of IndexReader are usually constructed with a call to one of the static open() methods, e.g. open(String).

For efficiency, in this API documents are often referred to via document numbers, non-negative integers which each name a unique document in the index. These document numbers are ephemeral--they may change as documents are added to and deleted from an index. Clients should thus not rely on a given document having the same number between sessions.

An IndexReader can be opened on a directory for which an IndexWriter is opened already, but it cannot be used to delete documents from the index then.

Definition at line 42 of file IndexReader.h.

Public Types

typedef void(* CloseCallback )(IndexReader *, void *)
enum  FieldOption {

Public Member Functions

 _CL_DEPRECATED (deleteDocuments) int32_t deleteTerm(Term *term)
 _CL_DEPRECATED (deleteDocument) void deleteDoc(const int32_t docNum)
void addCloseCallback (CloseCallback callback, void *parameter)
 CL_NS (store)
void close ()
virtual void commit ()
 Do not access this directly, only public so that MultiReader can access it.
void deleteDocument (const int32_t docNum)
int32_t deleteDocuments (Term *term)
virtual int32_t docFreq (const Term *t) const =0
virtual bool document (int32_t n, CL_NS(document)::Document *)=0
virtual void getFieldNames (FieldOption fldOption, CL_NS(util)::StringArrayWithDeletor &retarray)=0
virtual TermFreqVectorgetTermFreqVector (int32_t docNumber, const TCHAR *field)=0
virtual bool getTermFreqVectors (int32_t docNumber, Array< TermFreqVector * > &result)=0
int64_t getVersion ()
virtual bool hasDeletions () const =0
virtual bool hasNorms (const TCHAR *field)
bool isCurrent ()
virtual int32_t maxDoc () const =0
virtual void norms (const TCHAR *field, uint8_t *bytes)=0
virtual uint8_t * norms (const TCHAR *field)=0
virtual int32_t numDocs ()=0
void setNorm (int32_t doc, const TCHAR *field, uint8_t value)
void setNorm (int32_t doc, const TCHAR *field, float_t value)
TermDocstermDocs (Term *term) const
virtual TermDocstermDocs () const =0
TermPositionstermPositions (Term *term) const
virtual TermPositionstermPositions () const =0
virtual TermEnum * terms (const Term *t) const =0
virtual TermEnum * terms () const =0
void undeleteAll ()
virtual ~IndexReader ()
 Release the write lock, if needed.

Static Public Member Functions

static int64_t getCurrentVersion (const char *directory)
static int64_t getCurrentVersion (CL_NS(store)::Directory *directory)
static bool indexExists (const CL_NS(store)::Directory *directory)
static bool indexExists (const char *directory)
static bool isLocked (const char *directory)
 Checks if the index in the named directory is currently locked.
static bool isLocked (CL_NS(store)::Directory *directory)
 Checks if the index in the named directory is currently locked.
static bool isLuceneFile (const char *filename)
static uint64_t lastModified (const CL_NS(store)::Directory *directory)
static uint64_t lastModified (const char *directory)
static IndexReaderopen (CL_NS(store)::Directory *directory, bool closeDirectory=false)
 Returns an IndexReader reading the index in the given Directory.
static IndexReaderopen (const char *path)
 Returns an IndexReader reading the index in an FSDirectory in the named path.
static void unlock (const char *path)
static void unlock (CL_NS(store)::Directory *directory)

Protected Member Functions

virtual void doClose ()=0
 Implements close.
virtual void doDelete (const int32_t docNum)=0
virtual void doSetNorm (int32_t doc, const TCHAR *field, uint8_t value)=0
virtual void doUndeleteAll ()=0
 IndexReader (CL_NS(store)::Directory *directory, SegmentInfos *segmentInfos, bool closeDirectory)
 IndexReader (CL_NS(store)::Directory *dir)

Private Member Functions

void aquireWriteLock ()
virtual void doCommit ()=0

Private Attributes

CL_NS(store) typedef CL_NS(util)
bool closeDirectory
CL_NS(store) bool directoryOwner
bool hasChanges
SegmentInfos * segmentInfos
bool stale


class IndexReader::CommitLockWith
class IndexReader::LockWith


class  CloseCallbackCompare
class  CommitLockWith
class  LockWith

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index