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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8093 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 13 years ago
parent c584db991f
commit ee8b1d4de1

@ -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");

@ -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,

@ -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;

@ -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;
}
}

Loading…
Cancel
Save