Attaching a patch implementing my suggestion to add an explicit maximum field length parameter to IndexWriter constructors. I named the inner class MaxFieldLength instead of FieldLength.
The patch deprecates the pre-existing constructors, and adds a new constructor with the added parameter for each of the pre-existing constructors. As a result, the patch could be applied to the trunk as soon as 2.3 has been released; the deprecated pre-existing constructors would then be removed as part of the 3.0 release.
The patch also replaces all IndexWriter constructor calls in the tree with their equivalents taking the explicit max field length parameter. (I excluded IndexModifier, because it is already scheduled for removal as part of the 3.0 release.)
I see that in o.a.l.demo.IndexHTML.java, the max field length is set significantly above the current default limit:
71: writer = new IndexWriter(index, new StandardAnalyzer(), create);
Should the above two lines be replaced with the following? (I did not do this in the attached patch):
writer = new IndexWriter(index, new StandardAnalyzer(), create,
That is, should the demo use Integer.MAX_VALUE instead of 1,000,000 for the maximum field length?