Most of my terms return the correct position that they are in, but there is a percent or them that return really bad values. For example, I have a field that contains 5 terms, when I ask for term position of one of the terms (that I know is in position 3) I am getting a value of 43 returned. If I modify the data I am indexing and rebuild the index, it may cause different values for this same term to be returned such as 20 or 21.
When I build the index using the SimpleText codec and examine it, it shows the position correctly at 3 for the same term. Could there be fixes in later versions of Lucene that have fixed this and I need to upgrade? Or is there a bug lurking that under the right conditions cause this problem to manifest itself? for (int x = 0; x<postings.length; x++){ DocsAndPositionsEnum posting = postings[x].postings; try { int freq = posting.freq(); for (int y = 0; y<freq; y++){ int position = posting.nextPosition(); ...