%{
	#include "CLucene/index/DocumentWriter.h"
	#include "CLucene/index/SegmentMerger.h"
	#include "CLucene/index/TermVector.h"
%}

////////////////////////////////////////////////////////////////////////////////
//Term.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::termEquals;
%ignore lucene::index::termCompare;
%ignore lucene::index::Term::Term(const TCHAR* fld, const TCHAR* txt, const bool internField);
%ignore lucene::index::Term::Term();
%ignore lucene::index::Term::set;
%ignore lucene::index::Term::textLength;

////////////////////////////////////////////////////////////////////////////////
//Terms.h
////////////////////////////////////////////////////////////////////////////////
%nodefault lucene::index::TermDocs;
%nodefault lucene::index::TermEnum;
%nodefault lucene::index::TermPositions;

%ignore lucene::index::TermDocs::read(int32_t* docs, int32_t* freqs, int32_t length);


#ifdef SWIGCAP_NOOVERLOADING
	%rename (seekTerm) lucene::index::TermDocs::seek(Term* term);
	%rename (seekTermEnum) lucene::index::TermDocs::seek(TermEnum* termEnum);
#endif

%ignore lucene::index::TermEnum::term(const bool pointer);

////////////////////////////////////////////////////////////////////////////////
//IndexReader.h
////////////////////////////////////////////////////////////////////////////////
//%feature("notabstract") MultiReader;
%newobject lucene::index::IndexReader::open;
%newobject lucene::index::document;
%newobject lucene::index::IndexReader::terms(const lucene::index::Term* t) const;
%newobject lucene::index::IndexReader::getTermFreqVectors;
%newobject lucene::index::IndexReader::getTermFreqVector;
%newobject lucene::index::IndexReader::getIndexedFieldNames;

%ignore lucene::index::IndexReader(lucene::store::Directory* directory, SegmentInfos* segmentInfos, bool closeDirectory);
%ignore lucene::index::IndexReaderLockWith;
%ignore lucene::index::IndexReaderCommitLockWith;
%ignore lucene::index::IndexReader::doDelete;
//%ignore lucene::index::IndexReader::termPositions; //cant wrap this till we solve diamond inheritence
//%ignore lucene::index::IndexReader::termDocs; //cant wrap this till we solve diamond inheritence
%ignore lucene::index::IndexReader::norms(const TCHAR* field, uint8_t* bytes, const int32_t offset);
%ignore lucene::index::IndexReader::segmentInfos;

%newobject lucene::index::IndexReader::termDocs;
#ifdef SWIGCAP_NOOVERLOADING
	%rename (termDocsAll) lucene::index::IndexReader::termDocs() const;
	%rename (termDocsContaining) lucene::index::IndexReader::termDocs(Term* term) const;
#endif

%newobject lucene::index::IndexReader::termPositions;
#ifdef SWIGCAP_NOOVERLOADING
	%rename (termPositionsAll) lucene::index::IndexReader::termPositions() const;
	%rename (termPositionsContaining) lucene::index::IndexReader::termPositions(lucene::index::Term* term);
#endif


%newobject lucene::index::IndexReader::terms;
#ifdef SWIGCAP_NOOVERLOADING
	%rename (termsAll) lucene::index::IndexReader::terms() const;
	%rename (termsSpecific) lucene::index::IndexReader::terms(const lucene::index::Term* t) const;
#endif

#ifdef SWIGCAP_NOOVERLOADING
	%rename (setNormFloat) lucene::index::IndexReader::setNorm(int32_t doc, const TCHAR* field, float_t value);
	%rename (setNormByte) lucene::index::IndexReader::setNorm(int32_t doc, const TCHAR* field, uint8_t value);
#endif

%newobject lucene::index::IndexReader::getFieldNames;
#ifdef SWIGCAP_NOOVERLOADING
	%rename (getFieldNames) lucene::index::IndexReader::getFieldNames();
	%rename (getFieldNames_ex) lucene::index::IndexReader::getFieldNames(bool indexed);
#endif


////////////////////////////////////////////////////////////////////////////////
//DocumentWriter.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::Posting;

////////////////////////////////////////////////////////////////////////////////
//SegmentMerger.h
////////////////////////////////////////////////////////////////////////////////
LUCENE_ADDINREF1(lucene::index::SegmentMerger::add(SegmentReader* reader),1,2)


////////////////////////////////////////////////////////////////////////////////
//IndexWriter.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::IndexWriterLockWith;
%ignore lucene::index::IndexWriterLockWith2;
%ignore lucene::index::IndexWriter::segmentInfos;
%ignore lucene::index::IndexWriter::maxFieldLength;
%ignore lucene::index::IndexWriter::minMergeDocs;
%ignore lucene::index::IndexWriter::maxMergeDocs;
%ignore lucene::index::IndexWriter::addIndexes; //todo: need reader and directory arrays
%ignore lucene::index::IndexWriter::DEFAULT_MAX_FIELD_LENGTH;
%ignore lucene::index::IndexWriter::FIELD_TRUNC_POLICY__WARN;

////////////////////////////////////////////////////////////////////////////////
//MultiReader.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::MultiTermDocs;
%ignore lucene::index::MultiTermEnum;
%ignore lucene::index::MultiTermPositions;
LUCENE_ADDINREF1(lucene::index::MultiReader::MultiReader(Directory* directory, SegmentInfos* sis, bool closeDirectory, IndexReader** subReaders),1,2)
#ifndef _SUMO
	%ignore lucene::index::MultiReader::MultiReader(lucene::store::Directory* directory, SegmentInfos* sis, bool closeDirectory, IndexReader** subReaders);
#endif

////////////////////////////////////////////////////////////////////////////////
//TermVector.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::TermPositionVector;
%ignore lucene::index::TermVectorsReader;
%ignore lucene::index::TermVectorsWriter;
%ignore lucene::index::SegmentTermVector;
//%ignore lucene::index::TermFreqVector::getTermFrequencies; //todo: decide on this
%ignore lucene::index::TermFreqVector::indexesOf; //todo: decide on this


////////////////////////////////////////////////////////////////////////////////
//SegmentHeader.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::Norm;
%ignore lucene::index::SegmentTermDocs;
%ignore lucene::index::SegmentTermPositions;
%ignore lucene::index::SegmentReader::files;
%ignore lucene::index::SegmentReader::doClose;
%ignore lucene::index::SegmentReader::norms;
%ignore lucene::index::SegmentReader::SegmentName;


////////////////////////////////////////////////////////////////////////////////
//SegmentInfos.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::segmentInfosType;

////////////////////////////////////////////////////////////////////////////////
//CompoundFile.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::index::CSInputStream;
%ignore lucene::index::ReaderFileEntry;
%ignore lucene::index::WriterFileEntry;

////////////////////////////////////////////////////////////////////////////////
//now include local definition
%include "local_index.i"

//now include the clucene headers

#ifdef _SUMO
	%include "CLucene/index/SegmentInfos.h"
#endif

%include "CLucene/index/Term.h"
%include "CLucene/index/Terms.h"
%include "CLucene/index/TermVector.h"
%include "CLucene/index/IndexReader.h"
%include "CLucene/index/MultiReader.h"
%include "CLucene/index/IndexWriter.h"

#ifdef _SUMO
  %include "CLucene/index/DocumentWriter.h"
	%include "CLucene/index/CompoundFile.h"
	%include "CLucene/index/SegmentHeader.h"
	%include "CLucene/index/SegmentMerger.h"
#endif
