lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Homam S.A." <>
Subject Indexing a large number of DB records
Date Wed, 15 Dec 2004 02:42:38 GMT
I'm trying to index a large number of records from the
DB (a few millions). Each record will be stored as a
document with about 30 fields, most of them are
UnStored and represent small strings or numbers. No
huge DB Text fields.

But I'm running out of memory very fast, and the
indexing is slowing down to a crawl once I hit around
1500 records. The problem is each document is holding
references to the string objects returned from
ToString() on the DB field, and the IndexWriter is
holding references to all these document objects in
memory, so the garbage collector is getting a chance
to clean these up.

How do you guys go about indexing a large DB table?
Here's a snippet of my code (this method is called for
each record in the DB):

private void IndexRow(SqlDataReader rdr, IndexWriter
iw) {
	Document doc = new Document();
	for (int i = 0; i < BrowseFieldNames.Length; i++) {

Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.

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

View raw message