lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Lucene 4.1: IntField cannot be found by a NumericRangeFilter/NumericRangeQuery
Date Mon, 04 Mar 2013 16:15:40 GMT
The field is not indexed (see the debug output, it says indexed = false).

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Konstantyn Smirnov [mailto:injecteer@yahoo.com]
> Sent: Monday, March 04, 2013 5:09 PM
> To: java-user@lucene.apache.org
> Subject: Lucene 4.1: IntField cannot be found by a
> NumericRangeFilter/NumericRangeQuery
> 
> 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 searcher.search(...) brings no hits.
> 
> If I create a NumRangeQuery, the result is still empty.
> 
> What am I doing wrong?
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Lucene-
> 4-1-IntField-cannot-be-found-by-a-NumericRangeFilter-
> NumericRangeQuery-tp4044544.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message