Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

added new shell script to do a web search from the terminal

orbiter994c609cf8d0
diff --git a/bin/localsearch.sh b/bin/localsearch.sh
new file mode 100755
index 000000000..5ed4d4392
--- /dev/null
+++ b/bin/localsearch.sh
@@ -0,0 +1 @@
+curl -s "http://localhost:8080/yacysearch.rss?query=$1&resource=local&verify=false" | grep link | grep -v opensearchdescription | grep -v yacysearch | grep -v 'yacy:item' | sed 's/<link>//' | sed 's/<\/link>//'
diff --git a/bin/searchtest.sh b/bin/searchtest.sh
index 9d54e3ef1..859a9eb05 100755
--- a/bin/searchtest.sh
+++ b/bin/searchtest.sh
@@ -1,9 +1,11 @@
#!/bin/sh
+cd "`dirname $0`"
S=`date "+%s"`
C=0
for N in `cat searchtest.words`; do
-curl -s "http://localhost:8080/yacysearch.rss?query=$N&resource=local&verify=false" | grep link
-C=$(($C+1))
+ echo search for $N:
+ ./localsearch.sh $N
+ C=$(($C+1))
done
T=`date "+%s"`
echo runtime = $(($T-$S)) seconds, count = $C, time per query = $((1000*($T-$S)/$C)) milliseconds
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index 3a1d1ba97..7063160a8 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -116,6 +116,7 @@ public class yacysearch {
prop.put("input_constraint", "");
prop.put("input_cat", "href");
prop.put("input_depth", "0");
+ prop.put("input_verify", "true");
prop.put("input_contentdom", "text");
prop.put("input_contentdomCheckText", "1");
prop.put("input_contentdomCheckAudio", "0");
@@ -417,6 +418,7 @@ public class yacysearch {
prop.putHTML("input_prefermaskfilter", prefermask);
prop.put("input_indexof", (indexof) ? "on" : "off");
prop.put("input_constraint", (constraint == null) ? "" : constraint.exportB64());
+ prop.put("input_verify", (fetchSnippets) ? "true" : "false");
prop.put("input_contentdom", (post == null ? "text" : post.get("contentdom", "text")));
prop.put("input_contentdomCheckText", (contentdomCode == plasmaSearchQuery.CONTENTDOM_TEXT) ? "1" : "0");
prop.put("input_contentdomCheckAudio", (contentdomCode == plasmaSearchQuery.CONTENTDOM_AUDIO) ? "1" : "0");
diff --git a/htroot/yacysearch.rss b/htroot/yacysearch.rss
index c1cc45681..4ab51be57 100644
--- a/htroot/yacysearch.rss
+++ b/htroot/yacysearch.rss
@@ -8,11 +8,11 @@
<channel>
<title>YaCy P2P-Search for #[rss_query]#</title>
<description>Search for #[rss_query]#</description>
- <link>#[searchBaseURL]#?search=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#</link>
+ <link>#[searchBaseURL]#?query=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#&amp;verify=#[input_verify]#</link>
<image>
<url>#[rssYacyImageURL]#</url>
<title>Search for #[rss_query]#</title>
- <link>#[searchBaseURL]#?search=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#</link>
+ <link>#[searchBaseURL]#?query=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#&amp;verify=#[input_verify]#</link>
</image>
<opensearch:totalResults>#[num-results_totalcount]#</opensearch:totalResults>
<opensearch:startIndex>#[num-results_offset]#</opensearch:startIndex>