Have you uploaded data with that field populated? Solr is not like a relational 
database. It does not automatically populate a new field when you add it to the 
schema. If you sort on a field, a document with no data in that field comes 
first or last (I don't know which). 

----- Original Message -----
| From: "Dotan Cohen" <dotanco...@gmail.com>
| To: solr-user@lucene.apache.org
| Sent: Wednesday, October 31, 2012 6:54:47 PM
| Subject: Re: After adding field to schema, the field is not being returned in 
results.
| 
| On Thu, Nov 1, 2012 at 2:52 AM, Otis Gospodnetic
| <otis.gospodne...@gmail.com> wrote:
| > Hi,
| >
| > That should work just fine.  It;s either a bug or you are doing
| > something
| > you didn't mention.  Maybe you can provide a small, self-enclosed
| > unit test
| > and stick it in JIRA?
| >
| 
| I would assume that it's me doing something wrong! How does this
| look:
| 
| /solr/select?q=*&rows=1&sort=created_iso8601%20desc&fl=created_iso8601,created
| 
| <response>
|   <lst name="responseHeader">
|     <int name="status">0</int>
|     <int name="QTime">1</int>
|     <lst name="params">
|       <str name="q">*:*</str>
|       <str name="rows">1</str>
|       <str name="fl">created_iso8601,created</str>
|     </lst>
|   </lst>
|   <result name="response" numFound="1037937" start="0">
|     <doc>
|       <int name="created">1350854389</int>
|     </doc>
|   </result>
| </response>
| 
| Surely the sort parameter would throw an error if the
| created_iso8601field did not exist. That field is indexed and stored,
| with no parameters defined on handlers that may list the fields to
| return as Alexandre had mentioned.
| 
| 
| --
| Dotan Cohen
| 
| http://gibberish.co.il
| http://what-is-what.com
| 

Reply via email to