Permalink
Browse files

Fixed local image search pagination regression.

As reported by @tglman on issue #90, when searching images on the local
index only, pages next to the first were always empty. This was a
regression from commit c25e48e.
  • Loading branch information...
luccioman committed Jan 25, 2017
1 parent 54ffd92 commit fc01b69eca668e0b2b0bb24fc4fa096fab9c9372
Showing with 5 additions and 0 deletions.
  1. +5 −0 source/net/yacy/search/query/SearchEvent.java
@@ -250,6 +250,10 @@ protected SearchEvent(
this.peers = peers;
this.workTables = workTables;
this.query = query;
if(query != null) {
/* Image counter will eventually grow up faster than offset, but must start first with the same value as query offset */
this.imagePageCounter = query.offset;
}
this.loader = loader;
this.nodeStack = new WeakPriorityBlockingQueue<URIMetadataNode>(max_results_node, false);
this.maxExpectedRemoteReferences = new AtomicInteger(0);
@@ -1635,6 +1639,7 @@ public URIMetadataNode oneResult(final int item, final long timeout) {
return null;
}
/** Image results counter */
private int imagePageCounter = 0;
private LinkedHashMap<String, ImageResult> imageViewed = new LinkedHashMap<String, ImageResult>();
private LinkedHashMap<String, ImageResult> imageSpareGood = new LinkedHashMap<String, ImageResult>();

0 comments on commit fc01b69

Please sign in to comment.