edu.mayo.informatics.indexer.api
Interface SearchServiceInterface

All Known Implementing Classes:
LuceneIndexSearcher, LuceneMultiIndexSearcher

public interface SearchServiceInterface

This is the interface that you use to search an index.

Author:
Dan Armbrust , Kevin Peterson

Method Summary
 void close()
          Close.
 org.apache.lucene.search.Explanation explain(org.apache.lucene.search.Query query, int doc)
          Explain.
 int getHitTotal()
          Gets the hit total.
 org.apache.lucene.document.Document[] getNextSearchResults(int howMany)
          Gets the next search results.
 float[] getScores()
          Gets the scores.
 org.apache.lucene.search.Similarity getSimilarity()
          Gets the similarity.
 boolean hasMoreHits()
          Checks for more hits.
 org.apache.lucene.document.Document[] search(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, boolean skipLowScoring, int maxToReturn)
          Search.
 void search(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, org.apache.lucene.search.HitCollector hitCollector)
          Search.
 java.lang.String[] searchableFields()
          Searchable fields.
 void setSimilarity(org.apache.lucene.search.Similarity similarity)
          Sets the similarity.
 

Method Detail

searchableFields

java.lang.String[] searchableFields()
Searchable fields.

Returns:
the string[]

search

void search(org.apache.lucene.search.Query query,
            org.apache.lucene.search.Filter filter,
            org.apache.lucene.search.HitCollector hitCollector)
            throws InternalIndexerErrorException,
                   IndexSearchException
Search.

Parameters:
query - the query
filter - the filter
hitCollector - the hit collector
Throws:
InternalIndexerErrorException - the internal indexer error exception
IndexSearchException

search

org.apache.lucene.document.Document[] search(org.apache.lucene.search.Query query,
                                             org.apache.lucene.search.Filter filter,
                                             boolean skipLowScoring,
                                             int maxToReturn)
                                             throws InternalIndexerErrorException
Search.

Parameters:
query - the query
filter - the filter
skipLowScoring - the skip low scoring
maxToReturn - the max to return
Returns:
the document[]
Throws:
InternalIndexerErrorException - the internal indexer error exception

getNextSearchResults

org.apache.lucene.document.Document[] getNextSearchResults(int howMany)
                                                           throws InternalIndexerErrorException
Gets the next search results.

Parameters:
howMany - the how many
Returns:
the next search results
Throws:
InternalIndexerErrorException - the internal indexer error exception

hasMoreHits

boolean hasMoreHits()
Checks for more hits.

Returns:
true, if successful

getScores

float[] getScores()
                  throws InternalIndexerErrorException
Gets the scores.

Returns:
the scores
Throws:
InternalIndexerErrorException - the internal indexer error exception

getHitTotal

int getHitTotal()
Gets the hit total.

Returns:
the hit total

explain

org.apache.lucene.search.Explanation explain(org.apache.lucene.search.Query query,
                                             int doc)
                                             throws InternalIndexerErrorException
Explain.

Parameters:
query - the query
doc - the doc
Returns:
the explanation
Throws:
InternalIndexerErrorException - the internal indexer error exception

setSimilarity

void setSimilarity(org.apache.lucene.search.Similarity similarity)
                   throws InternalIndexerErrorException
Sets the similarity.

Parameters:
similarity - the new similarity
Throws:
InternalIndexerErrorException - the internal indexer error exception

getSimilarity

org.apache.lucene.search.Similarity getSimilarity()
Gets the similarity.

Returns:
the similarity

close

void close()
           throws InternalIndexerErrorException
Close.

Throws:
InternalIndexerErrorException - the internal indexer error exception

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.