Skip to content

Commit

Permalink
every time a crawl is started, the user expects a different search
Browse files Browse the repository at this point in the history
result behaviour. This requires that the search cache is flushed for
each crawl start. TODO: this should also be done if a crawl is
terminated.
  • Loading branch information
Orbiter committed Oct 1, 2015
1 parent c737ff2 commit 2252001
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions htroot/Crawler_p.java
Expand Up @@ -66,6 +66,7 @@
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.index.Fulltext;
import net.yacy.search.index.Segment;
import net.yacy.search.query.SearchEventCache;
import net.yacy.search.schema.CollectionSchema;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
Expand All @@ -76,8 +77,14 @@ public class Crawler_p {
// this servlet starts a web crawl. The interface for entering the web crawl parameters is in IndexCreate_p.html

public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {

// return variable that accumulates replacements
final Switchboard sb = (Switchboard) env;

// clean up all search events
SearchEventCache.cleanupEvents(true);
sb.index.clearCaches(); // every time the ranking is changed we need to remove old orderings

// inital values for AJAX Elements (without JavaScript)
final serverObjects prop = new serverObjects();
prop.put("rejected", 0);
Expand Down

0 comments on commit 2252001

Please sign in to comment.