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:
Ryan McKinley 2008-01-15 21:00:36 +00:00
parent 78ec5a3699
commit 63dfdc0d78
1 changed files with 5 additions and 2 deletions

View File

@ -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) {