add null pointer check to stopword fix

pull/1/head
reger 12 years ago
parent 7480e87386
commit d367b1f4d9

@ -387,6 +387,7 @@ public final class SearchEvent {
// only with the query minus the stopwords which had not been used for the search // only with the query minus the stopwords which had not been used for the search
boolean filtered = false; boolean filtered = false;
// check if query contains stopword // check if query contains stopword
if (Switchboard.stopwordHashes != null) {
Iterator<byte[]> it = query.getQueryGoal().getIncludeHashes().iterator(); Iterator<byte[]> it = query.getQueryGoal().getIncludeHashes().iterator();
while (it.hasNext()) { while (it.hasNext()) {
if (Switchboard.stopwordHashes.contains((it.next()))) { if (Switchboard.stopwordHashes.contains((it.next()))) {
@ -394,6 +395,7 @@ public final class SearchEvent {
break; break;
} }
} }
}
this.snippetFetchWordHashes = query.getQueryGoal().getIncludeHashes().clone(); this.snippetFetchWordHashes = query.getQueryGoal().getIncludeHashes().clone();
if (filtered) { // remove stopwords if (filtered) { // remove stopwords
this.snippetFetchWordHashes.excludeDestructive(Switchboard.stopwordHashes); this.snippetFetchWordHashes.excludeDestructive(Switchboard.stopwordHashes);

Loading…
Cancel
Save