Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixed unresolved pattern and unwanted local/global switch when using votes on search results

orbiteree8b1d4de10b
diff --git a/htroot/index.java b/htroot/index.java
index e6a97ac04..400274020 100644
--- a/htroot/index.java
+++ b/htroot/index.java
@@ -97,8 +97,8 @@ public class index {
prop.put("excluded", "0");
prop.put("combine", "0");
prop.put("resultbottomline", "0");
- prop.put("maximumRecords", maximumRecords);
prop.put("searchoptions", searchoptions);
+ prop.put("searchoptions_maximumRecords", maximumRecords);
prop.put("searchoptions_count-10", (count == 10) ? "1" : "0");
prop.put("searchoptions_count-50", (count == 50) ? "1" : "0");
prop.put("searchoptions_count-100", (count == 100) ? "1" : "0");
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index 36347aadc..51898b970 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -503,7 +503,7 @@ public class yacysearch {
}
// delete the search history since this still shows the entry
- SearchEventCache.cleanupEvents(true);
+ SearchEventCache.delete(delHash);
} catch (final IOException e) {
Log.logException(e);
}
@@ -596,7 +596,7 @@ public class yacysearch {
offset,
urlmask,
clustersearch && global ? QueryParams.Searchdom.CLUSTER :
- (global && indexReceiveGranted && !post.containsKey("deleteref") ? QueryParams.Searchdom.GLOBAL : QueryParams.Searchdom.LOCAL),
+ (global && indexReceiveGranted ? QueryParams.Searchdom.GLOBAL : QueryParams.Searchdom.LOCAL),
20,
constraint,
true,
diff --git a/source/net/yacy/search/query/SearchEventCache.java b/source/net/yacy/search/query/SearchEventCache.java
index 24e706c7b..92d1a4445 100644
--- a/source/net/yacy/search/query/SearchEventCache.java
+++ b/source/net/yacy/search/query/SearchEventCache.java
@@ -65,6 +65,13 @@ public class SearchEventCache {
if (oldEvent == null) cacheInsert++;
}
+ public static boolean delete(final String urlhash) {
+ for (final SearchEvent event: lastEvents.values()) {
+ if (event.result().delete(urlhash)) return true;
+ }
+ return false;
+ }
+
public static void cleanupEvents(boolean all) {
// remove old events in the event cache
if (MemoryControl.shortStatus()) all = true;
diff --git a/source/net/yacy/search/query/SnippetProcess.java b/source/net/yacy/search/query/SnippetProcess.java
index f130dfc26..a120403b5 100644
--- a/source/net/yacy/search/query/SnippetProcess.java
+++ b/source/net/yacy/search/query/SnippetProcess.java
@@ -36,6 +36,7 @@ import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.ranking.ScoreMap;
import net.yacy.cora.ranking.WeakPriorityBlockingQueue;
+import net.yacy.cora.ranking.WeakPriorityBlockingQueue.Element;
import net.yacy.cora.ranking.WeakPriorityBlockingQueue.ReverseElement;
import net.yacy.cora.services.federated.solr.SolrConnector;
import net.yacy.cora.services.federated.yacy.CacheStrategy;
@@ -532,4 +533,23 @@ public class SnippetProcess {
}
// finished, no more actions possible here
}
+
+ /**
+ * delete a specific entry from the search results
+ * this is used if the user clicks on a '-' sign beside the search result
+ * @param urlhash
+ * @return true if an entry was deleted, false otherwise
+ */
+ public boolean delete(final String urlhash) {
+ final Iterator<Element<ResultEntry>> i = this.result.iterator();
+ Element<ResultEntry> entry;
+ while (i.hasNext()) {
+ entry = i.next();
+ if (urlhash.equals(ASCII.String(entry.getElement().url().hash()))) {
+ i.remove();
+ return true;
+ }
+ }
+ return false;
+ }
}