Hi Ravic, You can use : SolrPluginUtils.html#docListToSolrDocumentList
--- On Wed, 9/26/12, ravicv <ravichandra...@gmail.com> wrote: > From: ravicv <ravichandra...@gmail.com> > Subject: How to retrive value from float field in custom request handler? > To: solr-user@lucene.apache.org > Date: Wednesday, September 26, 2012, 3:19 PM > HI All, > > I have wrote a custom request handler which will retrieve > some fields and > apply some business logic before sending response back. > > My schema is: > > <field name="field1" type="string" indexed="false" > stored="true" /> > <field name="field2" type="float" indexed="true" > stored="true" /> > > I am storing both fields, but i was unable to retrieve value > of field2. > I am able to retrieve value of field1. I tried to create a > new string > field(field3) and i am able to retrieve value. > > Is their any special way to retrieve values for float > fields? > Can someone throw some light on this... > > My custom handler code snippet: > > TopDocs top = searcher.search(QParser.getParser(query, > null, > localReq).getQuery(),10); > SolrIndexReader reader = searcher.getReader(); > if (top.totalHits > 0) { > try { > for (ScoreDoc hit : top.scoreDocs) { > Document doc = > reader.document(hit.doc); > > System.out.println(doc.getField("field1").stringValue()); // > Able to > retrive value > > System.out.println(doc.getField("field2").stringValue()); // > Not able to > retrive value > } > }catch(Exception e){} > > Thanks, > Ravi > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/How-to-retrive-value-from-float-field-in-custom-request-handler-tp4010478.html > Sent from the Solr - User mailing list archive at > Nabble.com. >