lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: Retrieving a float field
Date Thu, 09 Aug 2007 01:42:38 GMT
On 8/8/07, Seema Khandkar <Seema.Khandkar@cnet.com> wrote:
> Hi solr-users,
>
> If I have a float field (sfloat) stored and indexed in a solr index, how
> can I retrieve it within a plugin?=20
>
> Example:
> Document doc =3D solrIndexSearcher.doc(id);=20 String price =3D
> doc.get("price");=20
>
> The "price" string contains garbage value.

Try FieldType.toExternal() or toObject()

> Ideally I would like to restrict the fields I get back but that does not
> work either. I get back all fields for that document.
> Document doc =3D solrIndexSearcher.doc(id, fields);  // gives back all
> fields

I haven't tried that myself... I like sticking to the external HTTP
APIs for applications whenever possible.

-Yonik

Mime
View raw message