mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
- enhancement to kml search git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6867 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
586bc4d920
commit
4cd56d3966
|
@ -126,12 +126,12 @@ public class index {
|
||||||
prop.put("searchdomswitches_searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
|
prop.put("searchdomswitches_searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
|
||||||
prop.put("searchdomswitches_searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
|
prop.put("searchdomswitches_searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
|
||||||
prop.put("searchdomswitches_searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
|
prop.put("searchdomswitches_searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
|
||||||
|
prop.put("searchdomswitches_searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0");
|
||||||
|
prop.put("searchdomswitches_searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0");
|
||||||
|
prop.put("searchdomswitches_searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");
|
||||||
|
prop.put("searchdomswitches_searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0");
|
||||||
|
prop.put("searchdomswitches_searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0");
|
||||||
prop.put("searchoptions_display", display);
|
prop.put("searchoptions_display", display);
|
||||||
prop.put("searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0");
|
|
||||||
prop.put("searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0");
|
|
||||||
prop.put("searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");
|
|
||||||
prop.put("searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0");
|
|
||||||
prop.put("searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0");
|
|
||||||
// online caution timing
|
// online caution timing
|
||||||
sb.localSearchLastAccess = System.currentTimeMillis();
|
sb.localSearchLastAccess = System.currentTimeMillis();
|
||||||
|
|
||||||
|
|
|
@ -580,9 +580,9 @@ public class yacysearch {
|
||||||
try {
|
try {
|
||||||
synchronized (trackerHandles) {
|
synchronized (trackerHandles) {
|
||||||
trackerHandles.add(theQuery.handle);
|
trackerHandles.add(theQuery.handle);
|
||||||
if (trackerHandles.size() > 1000) trackerHandles.remove(trackerHandles.first());
|
while (trackerHandles.size() > 600) if (!trackerHandles.remove(trackerHandles.first())) break;
|
||||||
sb.localSearchTracker.put(client, trackerHandles);
|
|
||||||
}
|
}
|
||||||
|
sb.localSearchTracker.put(client, trackerHandles);
|
||||||
if (sb.localSearchTracker.size() > 1000) sb.localSearchTracker.remove(sb.localSearchTracker.keys().nextElement());
|
if (sb.localSearchTracker.size() > 1000) sb.localSearchTracker.remove(sb.localSearchTracker.keys().nextElement());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.logException(e);
|
Log.logException(e);
|
||||||
|
@ -691,11 +691,11 @@ public class yacysearch {
|
||||||
prop.put("searchdomswitches_searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
|
prop.put("searchdomswitches_searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
|
||||||
prop.put("searchdomswitches_searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
|
prop.put("searchdomswitches_searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
|
||||||
prop.put("searchdomswitches_searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
|
prop.put("searchdomswitches_searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
|
||||||
prop.put("searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0");
|
prop.put("searchdomswitches_searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0");
|
||||||
prop.put("searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0");
|
prop.put("searchdomswitches_searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0");
|
||||||
prop.put("searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");
|
prop.put("searchdomswitches_searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");
|
||||||
prop.put("searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0");
|
prop.put("searchdomswitches_searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0");
|
||||||
prop.put("searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0");
|
prop.put("searchdomswitches_searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0");
|
||||||
|
|
||||||
// for RSS: don't HTML encode some elements
|
// for RSS: don't HTML encode some elements
|
||||||
prop.putXML("rss_query", originalquerystring);
|
prop.putXML("rss_query", originalquerystring);
|
||||||
|
|
|
@ -62,11 +62,12 @@ public class yacysearch_location {
|
||||||
for (String s: message.getSubject()) subject += " " + s;
|
for (String s: message.getSubject()) subject += " " + s;
|
||||||
words += subject;
|
words += subject;
|
||||||
for (String word: words.split(" ")) if (word.length() >= 3) locations.addAll(LibraryProvider.geoDB.find(word, true, true, false, false, false));
|
for (String word: words.split(" ")) if (word.length() >= 3) locations.addAll(LibraryProvider.geoDB.find(word, true, true, false, false, false));
|
||||||
|
|
||||||
|
String locnames = "";
|
||||||
|
for (Location location: locations) locnames += ", " + location.getName();
|
||||||
|
if (locations.size() > 0) locnames = locnames.substring(2);
|
||||||
|
|
||||||
if (locations.size() > 0) {
|
for (Location location: locations) {
|
||||||
String locnames = "";
|
|
||||||
for (Location location: locations) locnames += ", " + location.getName();
|
|
||||||
locnames = locnames.substring(2);
|
|
||||||
// write for all locations a point to this message
|
// write for all locations a point to this message
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_location", locnames);
|
prop.put("kml_placemark_" + placemarkCounter + "_location", locnames);
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_name", message.getTitle());
|
prop.put("kml_placemark_" + placemarkCounter + "_name", message.getTitle());
|
||||||
|
@ -76,14 +77,9 @@ public class yacysearch_location {
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_description", message.getDescription());
|
prop.put("kml_placemark_" + placemarkCounter + "_description", message.getDescription());
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_date", message.getPubDate());
|
prop.put("kml_placemark_" + placemarkCounter + "_date", message.getPubDate());
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_url", message.getLink());
|
prop.put("kml_placemark_" + placemarkCounter + "_url", message.getLink());
|
||||||
int pc = 0;
|
prop.put("kml_placemark_" + placemarkCounter + "_pointname", location.getName());
|
||||||
for (Location location: locations) {
|
prop.put("kml_placemark_" + placemarkCounter + "_lon", location.lon());
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_point_" + pc + "_name", location.getName());
|
prop.put("kml_placemark_" + placemarkCounter + "_lat", location.lat());
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_point_" + pc + "_lon", location.lon());
|
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_point_" + pc + "_lat", location.lat());
|
|
||||||
pc++;
|
|
||||||
}
|
|
||||||
prop.put("kml_placemark_" + placemarkCounter + "_point", pc);
|
|
||||||
placemarkCounter++;
|
placemarkCounter++;
|
||||||
if (placemarkCounter >= maximumRecords) break loop;
|
if (placemarkCounter >= maximumRecords) break loop;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,12 @@
|
||||||
<Document>
|
<Document>
|
||||||
#{placemark}#
|
#{placemark}#
|
||||||
<Placemark>
|
<Placemark>
|
||||||
<name>#[name]#</name>
|
<name><![CDATA[#[name]#]]></name>
|
||||||
<description><![CDATA[<p>Location: #[location]#</p><p>Author: #[author]#</p><p>Publisher: #[copyright]#</p><p>Subject: #[subject]#</p><p>Abstract: #[description]#</p><p>Source: <a href="#[url]#">#[url]#</a></p>]]></description>
|
<description><![CDATA[<p>Location: #[location]#</p><p>Author: #[author]#</p><p>Publisher: #[copyright]#</p><p>Subject: #[subject]#</p><p>Abstract: #[description]#</p><p>Source: <a href="#[url]#">#[url]#</a></p>]]></description>
|
||||||
#{point}#
|
|
||||||
<Point>
|
<Point>
|
||||||
<name>#[name]#</name>
|
<name>#[pointname]#</name>
|
||||||
<coordinates>#[lon]#,#[lat]#</coordinates>
|
<coordinates>#[lon]#,#[lat]#</coordinates>
|
||||||
</Point>
|
</Point>
|
||||||
#{/point}#
|
|
||||||
<TimeStamp>
|
<TimeStamp>
|
||||||
<when>#[date]#</when>
|
<when>#[date]#</when>
|
||||||
</TimeStamp>
|
</TimeStamp>
|
||||||
|
|
|
@ -3,14 +3,12 @@
|
||||||
<Document>
|
<Document>
|
||||||
#{placemark}#
|
#{placemark}#
|
||||||
<Placemark>
|
<Placemark>
|
||||||
<name>#[name]#</name>
|
<name><![CDATA[#[name]#]]></name>
|
||||||
<description><![CDATA[<p>Location: #[location]#</p><p>Author: #[author]#</p><p>Publisher: #[copyright]#</p><p>Subject: #[subject]#</p><p>Abstract: #[description]#</p><p>Source: <a href="#[url]#">#[url]#</a></p>]]></description>
|
<description><![CDATA[<p>Location: #[location]#</p><p>Author: #[author]#</p><p>Publisher: #[copyright]#</p><p>Subject: #[subject]#</p><p>Abstract: #[description]#</p><p>Source: <a href="#[url]#">#[url]#</a></p>]]></description>
|
||||||
#{point}#
|
|
||||||
<Point>
|
<Point>
|
||||||
<name>#[name]#</name>
|
<name>#[pointname]#</name>
|
||||||
<coordinates>#[lon]#,#[lat]#</coordinates>
|
<coordinates>#[lon]#,#[lat]#</coordinates>
|
||||||
</Point>
|
</Point>
|
||||||
#{/point}#
|
|
||||||
<TimeStamp>
|
<TimeStamp>
|
||||||
<when>#[date]#</when>
|
<when>#[date]#</when>
|
||||||
</TimeStamp>
|
</TimeStamp>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user