com.fxpal.search
Interface RevertedSearcher

All Superinterfaces:
Searcher
All Known Implementing Classes:
LuceneRevertedSearcher

public interface RevertedSearcher
extends Searcher

Defines methods that generate query expansion terms from a reverted index. Also defines relevance feedback and pseudo-relevance feedback.

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

Method Summary
 RankedList runDocumentQuery(java.lang.Iterable<java.lang.String> docids)
          Runs a query consisting of a set of document ids
 RankedList runDocumentQuery(java.lang.Iterable<java.lang.String> docids, int nTerms)
          Runs a query consisting of a set of document ids
 RankedList runDocumentQuery(java.lang.String[] docids)
          Runs a query consisting of a String[] of document ids
 RankedList runDocumentQuery(java.lang.String[] docids, int nTerms)
          Runs a query consisting of a String[] of document ids
 RankedList runPrfQuery(RankedList list, int k, boolean useScores)
          Runs a query to generate expansion terms using pseudo-relevance feedback, picking the top k documents from the given list.
 RankedList runRfQuery(RankedList list, boolean useScores)
          Runs a query to generate expansion terms using relevance feedback, picking relevant documents from the given list.
 
Methods inherited from interface com.fxpal.search.Searcher
close, runQuery, runQuery
 

Method Detail

runDocumentQuery

RankedList runDocumentQuery(java.lang.Iterable<java.lang.String> docids)
                            throws QueryParsingException
Runs a query consisting of a set of document ids

Parameters:
docids - Iterable that enumerates the document ids.
Returns:
RankedList of expansion terms.
Throws:
QueryParsingException

runDocumentQuery

RankedList runDocumentQuery(java.lang.Iterable<java.lang.String> docids,
                            int nTerms)
                            throws QueryParsingException
Runs a query consisting of a set of document ids

Parameters:
docids - Iterable that enumerates the document ids.
nTerms - Number of expansion terms to generate.
Returns:
RankedList of expansion terms.
Throws:
QueryParsingException

runDocumentQuery

RankedList runDocumentQuery(java.lang.String[] docids)
                            throws QueryParsingException
Runs a query consisting of a String[] of document ids

Parameters:
docids - String[] that contains the document ids.
Returns:
RankedList of expansion terms.
Throws:
QueryParsingException

runDocumentQuery

RankedList runDocumentQuery(java.lang.String[] docids,
                            int nTerms)
                            throws QueryParsingException
Runs a query consisting of a String[] of document ids

Parameters:
docids - String[] that contains the document ids.
nTerms - Number of expansion terms to generate.
Returns:
RankedList of expansion terms.
Throws:
QueryParsingException

runPrfQuery

RankedList runPrfQuery(RankedList list,
                       int k,
                       boolean useScores)
                       throws QueryParsingException
Runs a query to generate expansion terms using pseudo-relevance feedback, picking the top k documents from the given list. The list should have been generated from the same inverted index that was used to create the reverted index. Document ids that are not found in the reverted index will not contribute query expansion terms, but no error will be generated. The RankedList returned by this method contains references to documents from the reverted index. Each "reverted document" is identified by a BasisQuery that serves as its id. The retrieval score (suitably normalized) serves as a measure of how representative the term is of the documents that were used to generate it. This RankedList of terms can be used to expand a query against an inverted index. See Searcher for the methods to do that.

Parameters:
list - RankedList of documents from an inverted index search.
k - Number of top documents used to generate expansion terms
useScores - if true, documents are given weights based on their score in the RankedList
Returns:
RankedList of expansion terms
Throws:
QueryParsingException

runRfQuery

RankedList runRfQuery(RankedList list,
                      boolean useScores)
                      throws QueryParsingException
Runs a query to generate expansion terms using relevance feedback, picking relevant documents from the given list. The RankedList returned by this method contains references to documents from the reverted index. Each "reverted document" is identified by a BasisQuery that serves as its id. The retrieval score (suitably normalized) serves as a measure of how representative the term is of the documents that were used to generate it. This RankedList of terms can be used to expand a query against an inverted index. See Searcher for the methods to do that.

Parameters:
list - RankedList of documents from an inverted index search. Relevant documents should be identified by marking the corresponding DocumentMatch as relevant.
useScores - if true, documents are given weights based on their score in the RankedList
Returns:
RankedList of expansion terms
Throws:
QueryParsingException