I am doing what I should not, i.e. iterating the Hits after a search to collect two ID fields from each document in Hits to pass back to the searcher along with the score.

The index is approx 10-15 fields per doc, and indexes mail data, which is not stored, as it exists elsewhere. Each mail has a unique object ID, so that gets indexed as the field "contentid".

I have been looking at HitCollector, but I was wondering the best way to collect the contentId field and score.

In HitCollector javadoc is says that you should not use IndexReader.getDocument(doc) during the collection loop, but is there any difference between

  searcher.search(query, new HitCollector() {
           public void collect(int doc, float score) {
               bits.set(doc);
           }
      });

  iterate bitset {
    IndexReader.getDocument(doc, FieldSelector)
    saveContentId()
  }

and

  searcher.search(query, new HitCollector() {
           public void collect(int doc, float score) {
               IndexReader.getDocument(doc, FieldSelector)
               saveContentId()
           }
      });

Given that I have to read the documents to get the relevant fields, does either method work?

Thanks
Antony



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to