how to get field contents out of Document object

2009-10-14 Thread Joe Calderon
hello *, sorry if this seems like a dumb question, im still fairly new
to working with lucene/solr internals.

given a Document object, what is the proper way to fetch an integer
value for a field called num_in_stock, it is both indexed and stored

thx much

--joe


Re: how to get field contents out of Document object

2009-10-14 Thread Yonik Seeley
On Wed, Oct 14, 2009 at 2:24 PM, Joe Calderon calderon@gmail.com wrote:
 hello *, sorry if this seems like a dumb question, im still fairly new
 to working with lucene/solr internals.

 given a Document object, what is the proper way to fetch an integer
 value for a field called num_in_stock, it is both indexed and stored

FieldType controls translation back and forth between Fields and
Strings/Objects.
See FieldType.toObject() or FieldType.storedToReadable()

-Yonik
http://www.lucidimagination.com