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 Yuhao <nf...@yahoo.com> on 2012/02/01 21:27:51 UTC

$doc.getFieldNames() - what determines the order of fields?

$doc.getFieldNames() will give you a list of field names as defined in your schema.xml file.  However, the order in which it returns the field names is not the same order that I defined them in schema.xml.  What determines the order returned by $doc.getFieldNames() ?

SOLVED Re: $doc.getFieldNames() - what determines the order of fields?

Posted by Yuhao <nf...@yahoo.com>.
I found the answer to my question.  The order is determined by the order in which the fields were defined in the input XML or JSON record for this document.



________________________________
 From: Yuhao <nf...@yahoo.com>
To: "solr-user@lucene.apache.org" <so...@lucene.apache.org> 
Sent: Wednesday, February 1, 2012 3:27 PM
Subject: $doc.getFieldNames() - what determines the order of fields?
 
$doc.getFieldNames() will give you a list of field names as defined in your schema.xml file.  However, the order in which it returns the field names is not the same order that I defined them in schema.xml.  What determines the order returned by $doc.getFieldNames() ?

Re: $doc.getFieldNames() - what determines the order of fields?

Posted by Erick Erickson <er...@gmail.com>.
Why do you care? That is, what is it you're doing that
is sensitive to the order of the return relative to the
order defined?

Best
Erick

On Wed, Feb 1, 2012 at 3:27 PM, Yuhao <nf...@yahoo.com> wrote:
> $doc.getFieldNames() will give you a list of field names as defined in your schema.xml file.  However, the order in which it returns the field names is not the same order that I defined them in schema.xml.  What determines the order returned by $doc.getFieldNames() ?