Thank you all for your help on this issue. As always, greatly appreciated.
I took the Store.YES away from the data fields and just left them
tokenized. The looping is now almost instant in all cases. I guess the
full OCR of the documents was slowing it down more than I thought it would.
Thank you again.
Trevor
Trevor Watson wrote:
I am currently attempting to create a comma separated list of IDs from
a given Hits collection.
However, when we end up processing 6,000 or more hits, it takes 25-30
seconds per collection. I've been trying to find a faster way to
change the search results to the comma separated list. Do any of you
have any advice? Thanks in advance.
Trevor Watson
My current code looks like
Lucene.Net.Search.Searcher search = new
Lucene.Net.Search.IndexSearcher(string.Format("c:\\sv_index\\" +
jobId.ToString()));
Lucene.Net.Search.Hits hits = search.Search(query);
string docIds = "";
totalDocuments = hits.Length();
// Test #1
Lucene.Net.Search.HitIterator hi =
(Lucene.Net.Search.HitIterator)hits.Iterator();
while (hi.MoveNext())
docIds +=
((Lucene.Net.Search.Hit)hi.Current).GetDocument().GetField("DocumentId").StringValue()
+ ", ";
// Test #2
for (int iCount = 0; iCount < totalDocuments; iCount++)
{
Lucene.Net.Documents.Document docHit = hits.Doc(iCount);
docIds += docHit.GetField("DocumentId").StringValue() +
", ";
}
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.14.3/2409 - Release Date: 10/02/09 06:46:00
------------------------------------------------------------------------