lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantyn Smirnov <>
Subject Lucene 4.1: IntField cannot be found by a NumericRangeFilter/NumericRangeQuery
Date Mon, 04 Mar 2013 16:09:09 GMT
Hi guys,

On my path of migrating from 3.6.x to 4.1, I'm facing the following problem:

I create a document with an IntField in it:

doc.add new IntField( 'freeSeats', 5, Store.YES )

After adding to the doc and writing to the index, the field looks like
(copied from eclipse debugger):

[20]	IntField  (id=11377)	
	boost	1.0	
	fieldsData	Integer  (id=11382)	.... 5
	internalReader	null	
	internalTokenStream	null	
	name	"freeSeats" (id=11387)	
	tokenStream	null	
	type	FieldType  (id=11390)	
		docValueType	null	
		frozen	true	
		indexed	false	
		indexOptions	FieldInfo$IndexOptions  (id=11394)	
		numericPrecisionStep	4	
		numericType	FieldType$NumericType  (id=11397)	
		omitNorms	false	
		stored	true	
		storeTermVectorOffsets	false	
		storeTermVectorPayloads	false	
		storeTermVectorPositions	false	
		storeTermVectors	false	
		tokenized	true	

Then I create a NumericRangeFilter:

BooleanQuery bq = ....

bq.add new FilterClause( NumericRangeFilter.newIntRange( 'freeSeats', 4, 1,
100, true, true ), Occur.MUST )

so it looks like that 

assert bq.toString() == 'BooleanFilter(+freeSeats:[1 TO 100])'

the eclispe debug-info for NRF:

query	NumericRangeQuery<T>  (id=11436)	
	boost	1.0	
	dataType	FieldType$NumericType  (id=11397)	
	field	"freeSeats" (id=11387)	
	max	Integer  (id=11440)	
	maxInclusive	true	
	min	Integer  (id=11441)	
	minInclusive	true	
	precisionStep	4	

But the brings no hits.

If I create a NumRangeQuery, the result is still empty.

What am I doing wrong?

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message