com.fxpal.search
Interface Searcher

All Known Subinterfaces:
RevertedSearcher
All Known Implementing Classes:
LuceneRevertedSearcher, LuceneSearcher

public interface Searcher

Searcher instances encapsulate the mechanics of running a query against an inverted index and returning a ranked list of documents. RevertedQuerying uses an instance to manage access to the inverted index.

Implementations should provide appropriate implementations to run queries.

Author:
Gene Golovchinsky and Jeremy Pickens (c) 2011 FX Palo Alto Laboratory, Inc.

Method Summary
 void close()
          Closes the underlying resources.
 RankedList runQuery(java.lang.String query)
          Runs a query and return a ranked list of documents.
 RankedList runQuery(java.lang.String query, RankedList expansionTerms)
          Expands the query with a RankedList of terms from a reverted index.
 

Method Detail

runQuery

RankedList runQuery(java.lang.String query)
                    throws QueryParsingException
Runs a query and return a ranked list of documents.

Parameters:
query - Query string
Returns:
RankedList that contains document ids that match the query, with their scores
Throws:
QueryParsingException

runQuery

RankedList runQuery(java.lang.String query,
                    RankedList expansionTerms)
                    throws QueryParsingException
Expands the query with a RankedList of terms from a reverted index.

Parameters:
query - Query that should be expanded
expansionTerms - RankedList that contains matches from a reverted index that will be used to expand the given query.
Returns:
RankedList that contains document ids that match the query, with their scores
Throws:
QueryParsingException

close

void close()
Closes the underlying resources. An instance can no longer be used for searching once it is closed.