fixed location search

pull/1/head
Michael Peter Christen 11 years ago
parent a1dd0ae62c
commit 30d4402cd1

@ -61,8 +61,8 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMe
ttl(new String[]{"ttl"}), ttl(new String[]{"ttl"}),
docs(new String[]{"docs"}), docs(new String[]{"docs"}),
size(new String[]{"size","length","yacy:size"}), size(new String[]{"size","length","yacy:size"}),
lon(new String[]{"geo:lon",Geo.Long.getURIref()}), lon(new String[]{"geo:lon", Geo.Long.getURIref()}),
lat(new String[]{Geo.Lat.getURIref()}); lat(new String[]{"geo:lat", Geo.Lat.getURIref()});
//point("gml:pos,georss:point,coordinates"); //point("gml:pos,georss:point,coordinates");
private Set<String> keys; private Set<String> keys;
@ -70,6 +70,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMe
private Token(final String[] keylist) { private Token(final String[] keylist) {
this.keys = new HashSet<String>(); this.keys = new HashSet<String>();
this.keys.addAll(Arrays.asList(keylist)); this.keys.addAll(Arrays.asList(keylist));
this.keys.add(this.name());
} }
public String valueFrom(final Map<String, String> map, final String dflt) { public String valueFrom(final Map<String, String> map, final String dflt) {
@ -262,7 +263,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMe
@Override @Override
public double getLon() { public double getLon() {
return Double.parseDouble(Token.lon.valueFrom(this.map, "0.0")); return Double.parseDouble(Token.lat.valueFrom(this.map, "0.0"));
} }
@Override @Override

@ -299,7 +299,10 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
// coordinates // coordinates
if (md.lat() != 0.0 && md.lon() != 0.0) { if (md.lat() != 0.0 && md.lon() != 0.0) {
if (allAttr || contains(CollectionSchema.coordinate_p)) add(doc, CollectionSchema.coordinate_p, Double.toString(md.lat()) + "," + Double.toString(md.lon())); // i.e. from <meta name="geo.position" content="50.78;11.52" /> or <meta name="ICBM" content="52.50695, 13.328348">
if (allAttr || contains(CollectionSchema.coordinate_p)) {
add(doc, CollectionSchema.coordinate_p, Double.toString(md.lat()) + "," + Double.toString(md.lon()));
}
} }
if (allAttr || contains(CollectionSchema.httpstatus_i)) add(doc, CollectionSchema.httpstatus_i, 200); if (allAttr || contains(CollectionSchema.httpstatus_i)) add(doc, CollectionSchema.httpstatus_i, 200);

Loading…
Cancel
Save