From 6ec9ced4cd57645dcca8e72e4b6eb63460ba9327 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 20 May 2010 15:07:57 +0000 Subject: [PATCH] - fix for multi-word search for locations - changed description text to 'title' entity (subject is a list of keywords and was very messed) - added ViewFile in location pop-up git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6891 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacysearch_location.html | 5 +++-- htroot/yacysearch_location.java | 3 +++ htroot/yacysearch_location.rss | 2 +- source/de/anomic/yacy/yacyClient.java | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htroot/yacysearch_location.html b/htroot/yacysearch_location.html index a55c37b7f..1e9e3a33d 100644 --- a/htroot/yacysearch_location.html +++ b/htroot/yacysearch_location.html @@ -44,9 +44,10 @@ ); #(initsearch)#:: - searchLayer_co = new OpenLayers.Layer.GeoRSS('GeoRSS', path_cosearch + '#[query]#', {'icon':marker_co}); + var query = '#[query]#'.replace(' ', '+'); + searchLayer_co = new OpenLayers.Layer.GeoRSS('GeoRSS', path_cosearch + query, {'icon':marker_co}); map.addLayer(searchLayer_co); - searchLayer_md = new OpenLayers.Layer.GeoRSS('GeoRSS', path_mdsearch + '#[query]#', {'icon':marker_md}); + searchLayer_md = new OpenLayers.Layer.GeoRSS('GeoRSS', path_mdsearch + query, {'icon':marker_md}); map.addLayer(searchLayer_md); #(/initsearch)# } diff --git a/htroot/yacysearch_location.java b/htroot/yacysearch_location.java index 93a362245..383057cf6 100644 --- a/htroot/yacysearch_location.java +++ b/htroot/yacysearch_location.java @@ -69,6 +69,9 @@ public class yacysearch_location { int placemarkCounter = 0; if (search_query) { Set locations = LibraryProvider.geoLoc.find(query, true); + for (String qp: query.split(" ")) { + locations.addAll(LibraryProvider.geoLoc.find(qp, true)); + } for (Location location: locations) { // write for all locations a point to this message prop.put("kml_placemark_" + placemarkCounter + "_location", location.getName()); diff --git a/htroot/yacysearch_location.rss b/htroot/yacysearch_location.rss index 6543a1149..e58547c12 100644 --- a/htroot/yacysearch_location.rss +++ b/htroot/yacysearch_location.rss @@ -19,7 +19,7 @@ <![CDATA[#[location]#]]> #[url]# #[date]# - + #[url]#

#[name]#

[metadata]]]>
#[lon]# #[lat]# diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.java index 6b02612e9..e4df355c8 100644 --- a/source/de/anomic/yacy/yacyClient.java +++ b/source/de/anomic/yacy/yacyClient.java @@ -507,7 +507,7 @@ public final class yacyClient { // prepare request final List post = new ArrayList(); - post.add(new DefaultCharsetStringPart("query", query.replaceAll(" ", "+"))); + post.add(new DefaultCharsetStringPart("query", query)); post.add(new DefaultCharsetStringPart("startRecord", Integer.toString(startRecord))); post.add(new DefaultCharsetStringPart("maximumRecords", Long.toString(maximumRecords))); post.add(new DefaultCharsetStringPart("verify", verify ? "true" : "false"));