SRU compliance according to

http://www.loc.gov/standards/sru/specs/search-retrieve.html
The example given on this page can be used to retrieve opensearch-compatible rss pages with YaCy

Try it:
The transcription to YaCys search servlet address is
http://localhost:8080/yacysearch.rss?version=1.1&operation=searchRetrieve&query=dinosaur&maximumRecords=1&recordSchema=dc

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4730 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 9b03310f8a
commit 2c0c8f0f0c

@ -91,7 +91,7 @@ public class yacysearch {
String client = (String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP); // the search client who initiated the search
// get query
String querystring = (post == null) ? "" : post.get("search", "").trim();
String querystring = (post == null) ? "" : post.get("query", post.get("search", "")).trim(); // SRU compliance
boolean rss = (post == null) ? false : post.get("rss", "false").equals("true");
if ((post == null) || (env == null) || (querystring.length() == 0) || (!searchAllowed)) {
@ -137,8 +137,9 @@ public class yacysearch {
}
if (sb.facilityDB != null) try { sb.facilityDB.update("zeitgeist", querystring, post); } catch (Exception e) {}
int itemsPerPage = post.getInt("count", 10);
int offset = post.getInt("offset", 0);
int itemsPerPage = post.getInt("maximumRecords", post.getInt("count", 10)); // SRU syntax with old property as alternative
int offset = post.getInt("startRecord", post.getInt("offset", 0));
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
final boolean indexof = post.get("indexof","").equals("on");
String urlmask = "";

Loading…
Cancel
Save