I've read page 154 of Hibernate Search in Action where Listing 5.22 gives an example of going through all Item entities and indexing them one by one. I did this and it worked... when my tables were small. Unfortunately as I've outlined in this stackoverflow question about ScrollableResults, it seems that MySQL loads
all rows for a ScrollableResult set into RAM before proceeding... so OutOfMemoryErrors are inevitable:
http://stackoverflow.com/questions/2826319/using-hibernates-scrollableresults-to-slowly-read-90-million-recordsWhat's the best approach for this?