IllegalArgumentException: docID must be = 0 and maxDoc=48736112 (got docID=2147483647)

2015-05-29 Thread Ahmet Arslan
Hello List, When a similarity returns NEGATIVE_INFINITY, hits[i].doc becomes 2147483647. Thus, exception is thrown in the following code: for (int i = 0; i hits.length; i++) { int docId = hits[i].doc; Document doc = searcher.doc(docId); } I know it is an awkward to return infinity (comes from

Re: IllegalArgumentException: docID must be = 0 and maxDoc=48736112 (got docID=2147483647)

2015-05-29 Thread Robert Muir
Hi Ahmet, Its due to the use of sentinel values by your collector in its priority queue by default. TopScoreDocCollector warns about this, and if you turn on assertions (-ea) you will hit them in your tests: * pbNOTE/b: The values {@link Float#NaN} and * {@link Float#NEGATIVE_INFINITY} are

Re: Specifying a Version vs. not specifying a Version

2015-05-29 Thread Chris Hostetter
: Now StandardTokenizer(Version, Reader) is deprecated and the docs say : to use StandardTokenizer(Reader) instead. But I can't do that, because : that constructor hardcodes Version.LATEST, which will break backwards : compatibility in the future (its Javadoc even confirms that this is : the