%{

%}
//default:
%ignore _search;

////////////////////////////////////////////////////////////////////////////////
//Similarity.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::search::DefaultSimilarity;
%ignore lucene::search::Similarity::idf(lucene::util::CLVector<lucene::index::Term*>* terms, Searcher* searcher);
%ignore lucene::search::Similarity::idf;
%ignore lucene::search::Similarity::tf;

////////////////////////////////////////////////////////////////////////////////
//Scorer.h
////////////////////////////////////////////////////////////////////////////////
%ignore Scorer;

////////////////////////////////////////////////////////////////////////////////
//Sort.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::search::SortComparatorSource; //decide on these sort classes
%ignore lucene::search::ScoreDocComparator;
%ignore lucene::search::SortComparator;
%ignore lucene::search::SortField::getFactory;
%ignore lucene::search::Sort::getFields;
%ignore lucene::search::SortField::SortField (const TCHAR* field, SortComparatorSource* comparator, bool reverse=false);
%immutable lucene::search::Sort::RELEVANCE;
%immutable lucene::search::Sort::INDEXORDER;
%immutable lucene::search::SortField::FIELD_SCORE;
%immutable lucene::search::SortField::FIELD_DOC;
LUCENE_ADDINREF1_CONSTRUCTOR(lucene::search::Sort::Sort(SortField* field),1,2)	
LUCENE_ADDINREFOBJARR1_CONSTRUCTOR(lucene::search::Sort::Sort(SortField** field),1,2,lucene::search::SortField*)	//todo: make object array referrer
LUCENE_ADDINREF1(lucene::search::Sort::setSort (SortField* field),1,2)	
LUCENE_ADDINREFOBJARR1(lucene::search::Sort::setSort (SortField** field),1,2,lucene::search::SortField*)	

#ifdef SWIGCAP_NOOVERLOADING
	//doubles
	%ignore lucene::search::Sort::Sort (const TCHAR* field);
	%ignore lucene::search::Sort::setSort (const TCHAR* field);

	%rename (setSortToField) lucene::search::Sort::setSort (const TCHAR* field, bool reverse);
	%rename (setSortToFields) lucene::search::Sort::setSort (const TCHAR** fieldnames);
	%rename (setSortToSortField) lucene::search::Sort::setSort (SortField* field);
	%rename (setSortToSrotFields) lucene::search::Sort::setSort (SortField** fields);
#endif

////////////////////////////////////////////////////////////////////////////////
//Explanation.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::search::Explanation::Explanation; //todo: decide on this. probably internal, so no constructor
%ignore lucene::search::Explanation::setDescription;
%ignore lucene::search::Explanation::getDetails; //need explanation array
%ignore LUCENE_SEARCH_EXPLANATION_DESC_LEN;

////////////////////////////////////////////////////////////////////////////////
//SearchHeader.h
////////////////////////////////////////////////////////////////////////////////
//todo: Searchable - decide on this.. may be unnecessary??/
#ifndef _SUMO
    %ignore lucene::search::HitDoc;
    
    %ignore lucene::search::Hits::Hits;
#endif

#ifdef SWIGCAP_NOOVERLOADING
    %rename (search) lucene::search::Searcher::search(Query* query);
    %rename (searchWithFilter) lucene::search::Searcher::search(Query* query, Filter* filter);
    %rename (searchWithSort) lucene::search::Searcher::search(Query* query, const Sort* sort);
    %rename (searchWithFilterAndSort) lucene::search::Searcher::search(Query* query, Filter* filter, const Sort* sort);
#endif

%nodefault lucene::search::Query;
%nodefault lucene::search::Searcher;
%ignore lucene::search::Weight;//todo: decide on this one
%nodefault lucene::search::Filter;
%ignore lucene::search::TopFieldDocs;//todo: decide on this one
%ignore lucene::search::HitCollector;//todo: decide on this one
%ignore lucene::search::TopDocs; //todo: decide on this one
%ignore lucene::search::SortedTopDocsCollector;
%ignore lucene::search::Searchable::_search;
%newobject lucene::search::Searcher::search;
%ignore lucene::search::Searchable::rewrite;

%ignore lucene::search::Query::combine;
%ignore lucene::search::Query::instanceOf;
%ignore lucene::search::Query::getQueryName;
%ignore lucene::search::Query::getClassName;
%ignore lucene::search::Query::weight;
%ignore lucene::search::Query::createWeight;
%ignore lucene::search::Query::mergeBooleanQueries;
%newobject lucene::search::Query::rewrite;
%ignore lucene::search::Query::scorer;
%ignore *::getQueryName;
%ignore *::getClassName;

////////////////////////////////////////////////////////////////////////////////
//MultiSearcher.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::search::MultiHitCollector;

////////////////////////////////////////////////////////////////////////////////
//TermQuery.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::search::TermWeight;

////////////////////////////////////////////////////////////////////////////////
//BooleanQuery.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::search::BooleanWeight;
%ignore lucene::search::BooleanQuery::getClauses; //todo: require array
%ignore lucene::search::BooleanQuery::add(BooleanClause* clause);
%ignore lucene::search::BooleanQuery::add(Query* query, const bool deleteQuery, const bool required, const bool prohibited);
LUCENE_ADDINREF1(lucene::search::BooleanQuery::add(Query* query, const bool required, const bool prohibited),1,2)

////////////////////////////////////////////////////////////////////////////////
//MultiTermQuery.h
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
//PhraseQuery.h
////////////////////////////////////////////////////////////////////////////////
%ignore lucene::search::PhraseWeight;
%ignore lucene::search::PhraseQuery::field;
%ignore lucene::search::PhraseQuery::terms;
%ignore lucene::search::PhraseQuery::prepare; //todo: decide on this
%ignore lucene::search::PhraseQuery::normalize; //todo: decide on this
%ignore lucene::search::PhraseQuery::sumOfSquaredWeights; //todo: decide on this
%ignore lucene::search::PhraseQuery::getTerms; //todo: need term array
%ignore lucene::search::PhraseQuery::getPositions; //todo: decide on this

#ifdef SWIGCAP_NOOVERLOADING
	%rename (addTo) lucene::search::PhraseQuery::add(lucene::index::Term* term, int32_t position);
#endif

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

//now include the clucene headers
%include "CLucene/search/Filter.h"
%include "CLucene/search/DateFilter.h"
%include "CLucene/search/Similarity.h"
%include "CLucene/search/Scorer.h"
%include "CLucene/search/Sort.h"
%include "CLucene/search/Explanation.h"
%include "CLucene/search/SearchHeader.h"
%include "CLucene/search/IndexSearcher.h"
%include "CLucene/search/MultiSearcher.h"
%include "CLucene/search/BooleanQuery.h"
%include "CLucene/search/TermQuery.h"
%include "CLucene/search/PhraseQuery.h"
%include "CLucene/search/MultiTermQuery.h"
%include "CLucene/search/WildcardQuery.h"
%include "CLucene/search/RangeQuery.h"
%include "CLucene/search/PrefixQuery.h"
