- bugfix for surrogate file reader

- bugfix for location search: suppress empty search
pull/1/head
Michael Peter Christen 13 years ago
parent 9b4c699526
commit 6e83b02b83

@ -66,7 +66,7 @@ public class yacysearch_location {
//i.e. http://localhost:8090/yacysearch_location.kml?query=berlin&maximumTime=2000&maximumRecords=100
int placemarkCounter = 0;
if (search_query) {
if (query.length() > 0 && search_query) {
final Set<Location> locations = LibraryProvider.geoLoc.find(query, true);
for (final String qp: query.split(" ")) {
locations.addAll(LibraryProvider.geoLoc.find(qp, true));
@ -88,7 +88,7 @@ public class yacysearch_location {
}
}
if (metatag || search_title || search_publisher || search_creator || search_subject) try {
if (query.length() > 0 && (metatag || search_title || search_publisher || search_creator || search_subject)) try {
// get a queue of search results
final String rssSearchServiceURL = "http://127.0.0.1:" + sb.getConfig("port", "8090") + "/yacysearch.rss";
final BlockingQueue<RSSMessage> results = new LinkedBlockingQueue<RSSMessage>();

@ -230,7 +230,7 @@ public class DCEntry extends TreeMap<String, String> {
public String[] getSubject() {
String t = this.get("categories");
if (t == null) this.get("dc:subject");
if (t == null) t = this.get("dc:subject");
t = stripCDATA(t);
if (t == null) return new String[]{};
return t.split(";");
@ -238,7 +238,7 @@ public class DCEntry extends TreeMap<String, String> {
public double getLon() {
String t = this.get("geo:long");
if (t == null) this.get("geo:lon");
if (t == null) t = this.get("geo:lon");
t = stripCDATA(t);
if (t == null) return 0.0d;
return Double.parseDouble(t);
@ -246,7 +246,7 @@ public class DCEntry extends TreeMap<String, String> {
public double getLat() {
String t = this.get("geo:lat");
if (t == null) this.get("geo:lat");
if (t == null) t = this.get("geo:lat");
t = stripCDATA(t);
if (t == null) return 0.0d;
return Double.parseDouble(t);

Loading…
Cancel
Save