AW: Indexing an IntField but getting SotredField from found Document

2015-02-19 Thread Clemens Wyss DEV
a dynamic framework ;) -Ursprüngliche Nachricht- Von: Ian Lea [mailto:ian@gmail.com] Gesendet: Donnerstag, 19. Februar 2015 16:16 An: java-user@lucene.apache.org Betreff: Re: Indexing an IntField but getting SotredField from found Document I think if you follow the Field.fieldType().num

Re: Indexing an IntField but getting SotredField from found Document

2015-02-19 Thread Ian Lea
I think if you follow the Field.fieldType().numericType() chain you'll end up with INT or DOUBLE or whatever. But if you know you stored it as an IntField then surely you already know it's an integer? Unless you sometimes store different things in the one field. I wouldn't do that. -- Ian. O

Indexing an IntField but getting SotredField from found Document

2015-02-19 Thread Clemens Wyss DEV
When I index a Document with an IntField and then find that very Document the former IntField is returned as StoredField. How do I determine the "original" fieldtype (IntField, LongField, DoubleField ...)? Must I ? Number number = Field.numericValue(); if( number != null ) { if( number instanc