mirror of https://github.com/apache/lucene.git
SOLR-446 -- make sure TextResponseWriter limits fields to returnFields if specified
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@612215 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
78ec5a3699
commit
63dfdc0d78
|
@ -342,11 +342,14 @@ final public class XMLWriter {
|
|||
startTag("doc", name, false);
|
||||
incLevel();
|
||||
|
||||
if (includeScore) {
|
||||
writeVal("score", doc.getFirstValue("score"));
|
||||
if (includeScore && returnFields != null ) {
|
||||
returnFields.add( "score" );
|
||||
}
|
||||
|
||||
for (String fname : doc.getFieldNames()) {
|
||||
if (returnFields!=null && !returnFields.contains(fname)) {
|
||||
continue;
|
||||
}
|
||||
Object val = doc.getFieldValue(fname);
|
||||
|
||||
if (val instanceof Collection) {
|
||||
|
|
Loading…
Reference in New Issue