0

I'm getting the following whenever I fire off a job,

database error: Runner error: Overflow sort stage buffered data usage of 33554495 bytes exceeds internal limit of 33554432 bytes

I know why this is, I also know how to increase that value but I'd rather use a index as suggested instead.

I've attempted to set an index but it seems to not work. All I've done is modified my POJO as such

@Indexed(direction = IndexDirection.DESCENDING)
String creationTime;

And then in my MongoItemReader

reader.setQuery(new Query().with(Sort.by(Order.desc("creationTime"))));

However that hasn't made a difference, is there more I need to do to enable that index?

Chris
  • 3,437
  • 6
  • 40
  • 73
  • In MongoDB dates are stored in ms since Jan 1, 1970, so there is no difference in indexing – Rcordoval Oct 23 '18 at 05:31
  • Good to know, but that doesn't really help me as I'm dealing with a string. – Chris Oct 23 '18 at 05:50
  • What makes you say that the mongo item reader is ignoring this index? Have you tried to read data from mongo with a mongoTemplate before using the Spring Batch reader? Do you have the issue using directly the mongoTemplate? – Mahmoud Ben Hassine Oct 23 '18 at 08:58

0 Answers0