git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3771 6c8d7289-2bf4-0310-a012-ef5d649a1542

pull/1/head
(no author) 18 years ago
parent 0610285c4f
commit 1efe607c34

@ -63,7 +63,7 @@
<tr class="TableCell#(dark)#Light::Dark#(/dark)#">
<td>#[host]#</td>
<td>#[count]#</td>
<td>#[dates]#</td>
<td>#{dates}##[date]# #{/dates}#</td>
</tr>
#{/list}#
</table>
@ -111,7 +111,7 @@
<td>#[host]#</td>
<td>#[peername]#</td>
<td>#[count]#</td>
<td>#[dates]#</td>
<td>#{dates}##[date]# #{/dates}#</td>
</tr>
#{/list}#
</table>

@ -67,6 +67,7 @@ public class SearchStatistics_p {
prop.put("page_list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
prop.put("page_list_" + entCount + "_host", (String) searchProfile.get("host"));
prop.put("page_list_" + entCount + "_date", yacyCore.universalDateShortString(new Date(trackerHandle.longValue())));
prop.put("page_list_" + entCount + "_timestamp", Long.toString(trackerHandle.longValue()));
if (page == 1) {
// local search
prop.put("page_list_" + entCount + "_offset", ((Integer) searchProfile.get("offset")).toString());
@ -87,7 +88,7 @@ public class SearchStatistics_p {
}
if ((page == 2) || (page == 4)) {
Iterator i = (page == 2) ? switchboard.localSearchTracker.entrySet().iterator() : switchboard.remoteSearchTracker.entrySet().iterator();
String host, handlestring;
String host;
TreeSet handles;
int entCount = 0;
Map.Entry entry;
@ -95,11 +96,17 @@ public class SearchStatistics_p {
entry = (Map.Entry) i.next();
host = (String) entry.getKey();
handles = (TreeSet) entry.getValue();
handlestring = "";
int dateCount = 0;
Iterator ii = handles.iterator();
while (ii.hasNext()) {
handlestring += yacyCore.universalDateShortString(new Date(((Long) ii.next()).longValue())) + " ";
Long timestamp = (Long) ii.next();
prop.put("page_list_" + entCount + "_dates_" + dateCount + "_date", yacyCore.universalDateShortString(new Date(timestamp.longValue())));
prop.put("page_list_" + entCount + "_dates_" + dateCount + "_timestamp", timestamp.toString());
dateCount++;
}
prop.put("page_list_" + entCount + "_dates", dateCount);
prop.put("page_list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
prop.put("page_list_" + entCount + "_host", host);
if (page == 4) {
@ -107,7 +114,7 @@ public class SearchStatistics_p {
prop.put("page_list_" + entCount + "_peername", (remotepeer == null) ? "UNKNOWN" : remotepeer.getName());
}
prop.put("page_list_" + entCount + "_count", new Integer(handles.size()).toString());
prop.put("page_list_" + entCount + "_dates", handlestring);
// next
entCount++;
}

@ -0,0 +1,42 @@
<?xml version="1.0"?>
<SearchStatistics>
#(page)#<!-- 0: info text -->
::<!-- 1: Search Statistics: Local Searches -->
<localSearchLog>#{list}#
<host>#[host]#</host>
<date timestamp="#[timestamp]#">#[date]#</date>
<offset>#[offset]#</offset>
<querycount>#[querycount]#</querycount>
<resultcount>#[resultcount]#</resultcount>
<querytime>#[querytime]#</querytime>
<resulttime>#[resulttime]#</resulttime>
<querystring>#[querystring]#</querystring>
#{/list}#</localSearchLog>
::<!-- 2: Search Statistics: Local Search Tracker -->
<localSearchTracker>#{list}#
<host>#[host]#</host>
<count>#[count]#</count>
<dates>#{dates}#
<date timestamp="#[timestamp]#">#[date]#</date>
#{/dates}#</dates>
#{/list}#</localSearchTracker>
::<!-- 3: Search Statistics: Remote Searches -->
<remoteSearchLog>#{list}#
<host>#[host]#</host>
<peername>#[peername]#</peername>
<date timestamp="#[timestamp]#">#[date]#</date>
<querycount>#[querycount]#</>
<resultcount>#[resultcount]#</resultcount>
<querytime>#[querytime]#</querytime>
<resulttime>#[resulttime]#</resulttime>
<queryhashes>#[queryhashes]#</queryhashes>
#{/list}#</remoteSearchLog>
::<!-- 4: Search Statistics: Remote Search Tracker -->
<remoteSearchTracker>#{list}#
#{/list}#</remoteSearchTracker>
#(/page)#
</SearchStatistics>

@ -70,7 +70,15 @@ public class SearchService extends AbstractService
private static final String TEMPLATE_URLINFO = "ViewFile.soap";
private static final String TEMPLATE_SNIPPET = "xml/snippet.xml";
private static final String TEMPLATE_OPENSEARCH = "opensearchdescription.xml";
private static final String TEMPLATE_SEARCHSTATS = "SearchStatistics_p.html";
/* =====================================================================
* Constants needed to get search statistic info
* ===================================================================== */
private static final int SEARCHSTATS_LOCAL_SEARCH_LOG = 1;
private static final int SEARCHSTATS_LOCAL_SEARCH_TRACKER = 2;
private static final int SEARCHSTATS_REMOTE_SEARCH_LOG = 3;
private static final int SEARCHSTATS_REMOTE_SEARCH_TRACKER = 4;
/**
* Constructor of this class
@ -302,5 +310,37 @@ public class SearchService extends AbstractService
// sending back the result to the client
return this.convertContentToXML(result);
}
private Document getSearchStatData(int page) throws Exception {
if (page < 1 || page > 4) throw new IllegalArgumentException("Illegal page number.");
// extracting the message context
extractMessageContext(AUTHENTICATION_NEEDED);
serverObjects post = new serverObjects();
post.put("page", Integer.toString(page));
// generating the template containing the network status information
byte[] result = this.serverContext.writeTemplate(TEMPLATE_SEARCHSTATS, post, this.requestHeader);
// sending back the result to the client
return this.convertContentToXML(result);
}
public Document getLocalSearchLog() throws Exception {
return this.getSearchStatData(SEARCHSTATS_LOCAL_SEARCH_LOG);
}
public Document getLocalSearchTracker() throws Exception {
return this.getSearchStatData(SEARCHSTATS_LOCAL_SEARCH_TRACKER);
}
public Document getRemoteSearchLog() throws Exception {
return this.getSearchStatData(SEARCHSTATS_REMOTE_SEARCH_LOG);
}
public Document getRemoteSearchTracker() throws Exception {
return this.getSearchStatData(SEARCHSTATS_REMOTE_SEARCH_TRACKER);
}
}

@ -1,76 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://yacy:8080/soap/search" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://yacy:8080/soap/search" xmlns:intf="http://yacy:8080/soap/search" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><!--WSDL created by Apache Axis version: 1.2RC2
Built on Nov 16, 2004 (12:19:44 EST)-->
<wsdl:message name="urlInfoByHashRequest">
<wsdl:part name="urlHash" type="soapenc:string"/>
<wsdl:part name="viewMode" type="xsd:int"/>
<wsdl:definitions targetNamespace="http://yacy:8080/soap/search" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://yacy:8080/soap/search" xmlns:intf="http://yacy:8080/soap/search" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:message name="getRemoteSearchTrackerRequest">
</wsdl:message>
<wsdl:message name="getOpenSearchDescriptionRequest">
</wsdl:message>
<wsdl:message name="getLocalSearchTrackerResponse">
<wsdl:part name="getLocalSearchTrackerReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="urlInfoResponse">
<wsdl:part name="urlInfoReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="snippetResponse">
<wsdl:part name="snippetReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="urlInfoRequest">
<wsdl:part name="urlStr" type="soapenc:string"/>
<wsdl:part name="urlStr" type="xsd:string"/>
<wsdl:part name="viewMode" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="getOpenSearchDescriptionRequest">
<wsdl:message name="snippetRequest">
<wsdl:part name="url" type="xsd:string"/>
<wsdl:part name="searchString" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getRemoteSearchTrackerResponse">
<wsdl:part name="getRemoteSearchTrackerReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="getOpenSearchDescriptionResponse">
<wsdl:part name="getOpenSearchDescriptionReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="getLocalSearchTrackerRequest">
</wsdl:message>
<wsdl:message name="searchResponse">
<wsdl:part name="searchReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="snippetResponse">
<wsdl:message name="getLocalSearchLogRequest">
</wsdl:message>
<wsdl:message name="getLocalSearchLogResponse">
<wsdl:part name="snippetReturn" type="apachesoap:Document"/>
<wsdl:part name="getLocalSearchLogReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="urlInfoByHashResponse">
<wsdl:part name="urlInfoByHashReturn" type="apachesoap:Document"/>
<wsdl:message name="urlInfoByHashRequest">
<wsdl:part name="urlHash" type="xsd:string"/>
<wsdl:part name="viewMode" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="snippetRequest">
<wsdl:part name="url" type="soapenc:string"/>
<wsdl:part name="searchString" type="soapenc:string"/>
<wsdl:message name="createNewXMLDocumentResponse">
<wsdl:part name="createNewXMLDocumentReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="urlInfoResponse">
<wsdl:part name="urlInfoReturn" type="apachesoap:Document"/>
<wsdl:message name="getRemoteSearchLogRequest">
</wsdl:message>
<wsdl:message name="createNewXMLDocumentRequest">
<wsdl:part name="rootElementName" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getRemoteSearchLogResponse">
<wsdl:part name="getRemoteSearchLogReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="urlInfoByHashResponse">
<wsdl:part name="urlInfoByHashReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="searchRequest">
<wsdl:part name="searchString" type="soapenc:string"/>
<wsdl:part name="searchString" type="xsd:string"/>
<wsdl:part name="maxSearchCount" type="xsd:int"/>
<wsdl:part name="searchOrder" type="soapenc:string"/>
<wsdl:part name="searchMode" type="soapenc:string"/>
<wsdl:part name="searchOrder" type="xsd:string"/>
<wsdl:part name="searchMode" type="xsd:string"/>
<wsdl:part name="maxSearchTime" type="xsd:int"/>
<wsdl:part name="urlMask" type="xsd:boolean"/>
<wsdl:part name="urlMaskfilter" type="soapenc:string"/>
<wsdl:part name="prefermaskfilter" type="soapenc:string"/>
<wsdl:part name="category" type="soapenc:string"/>
<wsdl:part name="urlMaskfilter" type="xsd:string"/>
<wsdl:part name="prefermaskfilter" type="xsd:string"/>
<wsdl:part name="category" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="SearchService">
<wsdl:operation name="search" parameterOrder="searchString maxSearchCount searchOrder searchMode maxSearchTime urlMask urlMaskfilter prefermaskfilter category">
<wsdl:input message="impl:searchRequest" name="searchRequest"/>
<wsdl:output message="impl:searchResponse" name="searchResponse"/>
<wsdl:input message="intf:searchRequest" name="searchRequest"/>
<wsdl:output message="intf:searchResponse" name="searchResponse"/>
</wsdl:operation>
<wsdl:operation name="urlInfo" parameterOrder="urlStr viewMode">
<wsdl:input message="intf:urlInfoRequest" name="urlInfoRequest"/>
<wsdl:output message="intf:urlInfoResponse" name="urlInfoResponse"/>
</wsdl:operation>
<wsdl:operation name="urlInfoByHash" parameterOrder="urlHash viewMode">
<wsdl:input message="intf:urlInfoByHashRequest" name="urlInfoByHashRequest"/>
<wsdl:output message="intf:urlInfoByHashResponse" name="urlInfoByHashResponse"/>
</wsdl:operation>
<wsdl:operation name="snippet" parameterOrder="url searchString">
<wsdl:input message="impl:snippetRequest" name="snippetRequest"/>
<wsdl:output message="impl:snippetResponse" name="snippetResponse"/>
<wsdl:input message="intf:snippetRequest" name="snippetRequest"/>
<wsdl:output message="intf:snippetResponse" name="snippetResponse"/>
</wsdl:operation>
<wsdl:operation name="urlInfo" parameterOrder="urlStr viewMode">
<wsdl:input message="impl:urlInfoRequest" name="urlInfoRequest"/>
<wsdl:output message="impl:urlInfoResponse" name="urlInfoResponse"/>
<wsdl:operation name="getOpenSearchDescription">
<wsdl:input message="intf:getOpenSearchDescriptionRequest" name="getOpenSearchDescriptionRequest"/>
<wsdl:output message="intf:getOpenSearchDescriptionResponse" name="getOpenSearchDescriptionResponse"/>
</wsdl:operation>
<wsdl:operation name="getLocalSearchLog">
<wsdl:input message="intf:getLocalSearchLogRequest" name="getLocalSearchLogRequest"/>
<wsdl:operation name="urlInfoByHash" parameterOrder="urlHash viewMode">
<wsdl:input message="impl:urlInfoByHashRequest" name="urlInfoByHashRequest"/>
<wsdl:output message="impl:urlInfoByHashResponse" name="urlInfoByHashResponse"/>
<wsdl:output message="intf:getLocalSearchLogResponse" name="getLocalSearchLogResponse"/>
</wsdl:operation>
<wsdl:operation name="getOpenSearchDescription">
<wsdl:input message="impl:getOpenSearchDescriptionRequest" name="getOpenSearchDescriptionRequest"/>
<wsdl:output message="impl:getOpenSearchDescriptionResponse" name="getOpenSearchDescriptionResponse"/>
<wsdl:operation name="getLocalSearchTracker">
<wsdl:input message="intf:getLocalSearchTrackerRequest" name="getLocalSearchTrackerRequest"/>
<wsdl:output message="intf:getLocalSearchTrackerResponse" name="getLocalSearchTrackerResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:operation name="getRemoteSearchLog">
<wsdl:input message="intf:getRemoteSearchLogRequest" name="getRemoteSearchLogRequest"/>
<wsdl:output message="intf:getRemoteSearchLogResponse" name="getRemoteSearchLogResponse"/>
<wsdl:binding name="searchSoapBinding" type="impl:SearchService">
</wsdl:operation>
<wsdl:operation name="getRemoteSearchTracker">
<wsdl:input message="intf:getRemoteSearchTrackerRequest" name="getRemoteSearchTrackerRequest"/>
<wsdl:output message="intf:getRemoteSearchTrackerResponse" name="getRemoteSearchTrackerResponse"/>
</wsdl:operation>
<wsdl:operation name="createNewXMLDocument" parameterOrder="rootElementName">
<wsdl:input message="intf:createNewXMLDocumentRequest" name="createNewXMLDocumentRequest"/>
<wsdl:output message="intf:createNewXMLDocumentResponse" name="createNewXMLDocumentResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="searchSoapBinding" type="intf:SearchService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="search">
<wsdlsoap:operation soapAction=""/>
@ -78,8 +129,28 @@ Built on Nov 16, 2004 (12:19:44 EST)-->
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="searchResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="urlInfo">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="urlInfoRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="urlInfoResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="urlInfoByHash">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="urlInfoByHashRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="urlInfoByHashResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="snippet">
@ -88,44 +159,75 @@ Built on Nov 16, 2004 (12:19:44 EST)-->
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="snippetResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="urlInfo">
<wsdl:operation name="getOpenSearchDescription">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="urlInfoRequest">
<wsdl:input name="getOpenSearchDescriptionRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="urlInfoResponse">
<wsdl:output name="getOpenSearchDescriptionResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getLocalSearchLog">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getLocalSearchLogRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="getLocalSearchLogResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="urlInfoByHash">
<wsdl:operation name="getLocalSearchTracker">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="urlInfoByHashRequest">
<wsdl:input name="getLocalSearchTrackerRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="urlInfoByHashResponse">
<wsdl:output name="getLocalSearchTrackerResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getRemoteSearchLog">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getRemoteSearchLogRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="getRemoteSearchLogResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getOpenSearchDescription">
<wsdl:operation name="getRemoteSearchTracker">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getOpenSearchDescriptionRequest">
<wsdl:input name="getRemoteSearchTrackerRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="getOpenSearchDescriptionResponse">
<wsdl:output name="getRemoteSearchTrackerResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="createNewXMLDocument">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="createNewXMLDocumentRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.anomic.de" use="encoded"/>
</wsdl:input>
<wsdl:output name="createNewXMLDocumentResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/search" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SearchServiceService">
<wsdl:port binding="impl:searchSoapBinding" name="search">
<wsdl:port binding="intf:searchSoapBinding" name="search">
<wsdlsoap:address location="http://yacy:8080/soap/search"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Loading…
Cancel
Save