lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <>
Subject Re: IndexSearcher with two Indexes
Date Fri, 27 Jan 2012 22:10:04 GMT
On Fri, Jan 27, 2012 at 4:53 PM, Hany Azzam <> wrote:
> Hi Robert,
> Thanks for the reply. I am trying to do something different. If I use a mutireader then
the searching/scoring will take place over the two indexes at the same time. However, in my
case the subcomponents of the retrieval model are calculated over separate evidence spaces.
For example, the retrieval model calculates something like that:
> score := P(query_term | documents) * P(query_term | relevant_documents)
> The P(query_term | documents) can be estimated using the index over the whole collection
of documents. The P(query_term | relevant_documents) can be estimated using the index over
the relevant documents only (which are known prior to the execution of the query).

In this situation, if you want to combine the statistics from
different indexes in your own way, you can look at
IndexSearcher.termStatistics() and
These are intended for situations like distributed search, but maybe
you can make use of them.

here is some pseudocode:

    IndexReader relevant =;
    IndexReader documents =;

    final IndexSearcher relevantSearcher = new IndexSearcher(relevant);
    IndexSearcher documentsSearcher = new IndexSearcher(documents) {

      public CollectionStatistics collectionStatistics(String field)
throws IOException {
        CollectionStatistics documentStats = super.collectionStatistics(field);
        return new CollectionStatistics(...
someCombinationOf(documentStats + stuff from relevantSearcher));

      // do a similar thing for termStatistics()....


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message