I need to range query for an Integer field. I tried a lot and searched a lot too but I can’t make it work the way it should be, at least in my opinion. I was able to make it work with a PaddedIntegerBridge (Example under 4.4.3 in Hibernate Documentation)
but I would like to do it right (Point 4.4.1 says “Integer are per default indexed numerically using a Trie structure which allows for efficient range queries and sorting, resulting in better query response times.”)
Property look like this:
@Field(index = Index.YES, indexNullAs = "-1", analyze = Analyze.NO, store = Store.YES) @Column(name = "ViewAgeInDays_Min") private Integer minAgeInDays;
@NumericField was omitted because I read that it is not necessary and it does not change anything when used.
For testing I had two datasets with values 100 and 300.
+ViewAgeInDays_Min:[150 TO *]
gives both as result
+ViewAgeInDays_Min:[150 TO 700]
gives no result.
What am I missing here?
Thangs in advance!