You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Joe Calderon <ca...@gmail.com> on 2009/10/14 20:24:49 UTC

how to get field contents out of Document object

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

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Wed, Oct 14, 2009 at 2:24 PM, Joe Calderon <ca...@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