more performQuery cleanup

This commit is contained in:
Jeff Wallace 2013-12-06 15:28:01 -05:00
parent 23ec64c459
commit 67d2f81252

View File

@ -305,11 +305,10 @@ public class LuceneQuery implements KeywordSearchQuery {
final int sepIndex = resultID.indexOf(Server.ID_CHUNK_SEP); final int sepIndex = resultID.indexOf(Server.ID_CHUNK_SEP);
String snippet = ""; String snippet = "";
if (snippets) { if (snippets) {
try { List<String> snippetList = highlightResponse.get(resultID).get(Server.Schema.CONTENT.toString());
snippet = highlightResponse.get(resultID).get(Server.Schema.CONTENT.toString()).get(0); // list is null if there wasn't a snippet
snippet = EscapeUtil.unEscapeHtml(snippet).trim(); if (snippetList != null) {
} catch (NullPointerException ex) { snippet = EscapeUtil.unEscapeHtml(snippetList.get(0)).trim();
snippet = "";
} }
} }
if (sepIndex != -1) { if (sepIndex != -1) {