By the way: This is documented:
http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc/core/org/apac
he/lucene/document/NumericField.html

NOTE: This class is only used during indexing. When retrieving the stored
field value from a Document instance after search, you will get a
conventional Fieldable instance where the numeric values are returned as
Strings (according to toString(value) of the used data type).

(this o.a.l.document.Fieldable is always a o.a.l.document.Field)

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


> -----Original Message-----
> From: Uwe Schindler [mailto:u...@thetaphi.de]
> Sent: Friday, September 11, 2009 10:38 PM
> To: java-dev@lucene.apache.org
> Subject: RE: NumericRange Field and LuceneUtils?
> 
> Hallo Daniel,
> 
> I am not really sure what you are talking about (what is LuceneUtils?).
> 
> To your question about NumericField: NumericField is only used for
> indexing.
> If you also store the field to retrieve it from the index e.g. with search
> results, NumericField creates a stored Field containing the number as a
> conventional string (the special trie encoding is only used for *indexing*
> not *storing*). If you call getField() it returns a standard Field
> containg
> the number as String.
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: u...@thetaphi.de
> 
> > -----Original Message-----
> > From: Daniel Shane [mailto:sha...@lexum.umontreal.ca]
> > Sent: Friday, September 11, 2009 9:01 PM
> > To: java-dev@lucene.apache.org
> > Subject: NumericRange Field and LuceneUtils?
> >
> > Is it normal that LuceneUtils.getString(Document document, String
> > fieldName) uses document.getField() in the background?
> >
> > If, for example, you indexed something using the new NumericRange field,
> > then you will get a class cast exception in there.
> >
> > Would it not be better to call getFieldable() instead of getField()?
> >
> > Daniel Shane
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
> > For additional commands, e-mail: java-dev-h...@lucene.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-dev-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to