1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

Handle rare case when running solr query expected to have matches, yields no results and highlight is not fully initialized

This commit is contained in:
adam-m
2012-05-18 12:16:07 -04:00
parent 37c6082c6d
commit 648f290dc1

View File

@@ -240,11 +240,15 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
@Override
public boolean hasNextItem() {
if (!this.pagesToHits.containsKey(currentPage))
return false;
return this.pagesToHits.get(currentPage) < this.hitsPages.get(currentPage);
}
@Override
public boolean hasPreviousItem() {
if (!this.pagesToHits.containsKey(currentPage))
return false;
return this.pagesToHits.get(currentPage) > 1;
}
@@ -270,6 +274,8 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
@Override
public int currentItem() {
if (!this.pagesToHits.containsKey(currentPage))
return 0;
return pagesToHits.get(currentPage);
}
@@ -383,6 +389,8 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
@Override
public int getNumberHits() {
if (!this.hitsPages.containsKey(this.currentPage))
return 0;
return this.hitsPages.get(this.currentPage);
}