gate.creole.annic
Interface Searchable

All Known Subinterfaces:
SearchableDataStore
All Known Implementing Classes:
LuceneDataStoreImpl

public interface Searchable

The interface declares methods which should be implemented by an object wishing to get indexed and being searchable.

Author:
niraj

Method Summary
 Indexer getIndexer()
          Returns the Indexer
 Searcher getSearcher()
          Returns the Searcher
 Hit[] next(int numberOfPatterns)
           
 boolean search(String query, Map searchParameters)
           
 void setIndexer(Indexer indexer, Map parameters)
          This method is used to specify the indexer which is used to index documents
 void setSearcher(Searcher searcher)
          This method is used to specify the searcher which is used for searchering the index
 

Method Detail

setIndexer

void setIndexer(Indexer indexer,
                Map parameters)
                throws IndexException
This method is used to specify the indexer which is used to index documents

Parameters:
indexer -
parameters - - parameters required by the specific implementation of provided indexer
Throws:
IndexException

getIndexer

Indexer getIndexer()
Returns the Indexer


setSearcher

void setSearcher(Searcher searcher)
                 throws SearchException
This method is used to specify the searcher which is used for searchering the index

Parameters:
searcher -
Throws:
SearchException

getSearcher

Searcher getSearcher()
Returns the Searcher


search

boolean search(String query,
               Map searchParameters)
               throws SearchException
Parameters:
query -
searchParameters - - parameters required for searching an index (e.g. location of the index)
Returns:
true if the search was successful
Throws:
SearchException

next

Hit[] next(int numberOfPatterns)
           throws SearchException
Parameters:
numberOfPatterns -
Returns:
an Array of Hit that has atleast a document ID, start and end offset and the original query string
Throws:
SearchException