fix "null" title in response writer for documents with multivalued title

pull/1/head
reger 10 years ago
parent 73ba5d8ef7
commit 51ec9c1f44

@ -127,8 +127,8 @@ public class HTMLResponseWriter implements QueryResponseWriter {
int id = iterator.nextDoc(); int id = iterator.nextDoc();
Document doc = searcher.doc(id, DEFAULT_FIELD_LIST); Document doc = searcher.doc(id, DEFAULT_FIELD_LIST);
LinkedHashMap<String, String> tdoc = translateDoc(schema, doc); LinkedHashMap<String, String> tdoc = translateDoc(schema, doc);
String title = tdoc.get(CollectionSchema.title.getSolrFieldName()); String title = doc.get(CollectionSchema.title.getSolrFieldName()); // title is multivalued, after translation fieldname could be in tdoc. "title_0" ..., so get it from doc
if (sz == 1) { if (sz == 1) {
writer.write("<title>" + title + "</title>\n</head><body>\n"); writer.write("<title>" + title + "</title>\n</head><body>\n");
} else { } else {

Loading…
Cancel
Save