Don't try doing this with the "text" field of the Solr example schema, which is a catchall field that is populated via CopyFields. Rather, add the original source field(s) to "fl" that was/were copied to the catchall field. The catchall field is designed for indexing, not result display. But do make sure that "stored=true" for any field you want returned in search results.

-- Jack Krupansky

-----Original Message----- From: Sascha Szott
Sent: Saturday, June 30, 2012 6:39 AM
To: [email protected]
Subject: Re: how to retrieve a doc from its docID ?

Hi,

did you include the fl parameter in the Solr query URL? If that's the case make sure that the field name 'text' is mentioned there. You should also make sure that the field definition (in schema.xml) for 'text' says stored="true", otherwise the field will not be returned.

-Sascha



Giovanni Gherdovich <[email protected]> schrieb:

Hi all,

when querying my solr instance, the answers I get
are the document IDs of my docs. Here is how one of my docs
looks like:

-- -- >8 -- -- >8 -- -- >8 -- -- >8 -- -- >8 -- --
<add>
<doc>
<field name="text">hello solar!</field>
<field name="id">123</field>
</doc>
</add>
-- -- >8 -- -- >8 -- -- >8 -- -- >8 -- -- >8 -- --

here is the response if I query for "solar" :

-- -- >8 -- -- >8 -- -- >8 -- -- >8 -- -- >8 -- --
<response>
<lst name="responseHeader"></lst>
<result name="response" numFound="1" start="0" maxScore="1.0">
<doc><float name="score">1.0</float>
<str name="id">123</str></doc>
</result>
</response>
-- -- >8 -- -- >8 -- -- >8 -- -- >8 -- -- >8 -- --

which is, solr gives me the doc ID. How to retrieve the doc's field "text"
given its id ?

cheers,
Giovanni

Reply via email to