Differences between revisions 2 and 3
Revision 2 as of 2008-09-12 12:30:51
Size: 7630
Editor: kfc
Comment:
Revision 3 as of 2008-10-17 10:11:17
Size: 3911
Editor: bam
Comment: Search API Work in Progress
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Searching Fedora is possible, using a simple method. Simply give a string, and get results back encoded in XML DOMS Search uses simple search methods of the Summa Search interface.
Line 5: Line 5:
WSDL: WSDL: attachment:DomsGUISearch.wsdl
Line 7: Line 7:
{{{
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://statsbiblioteket.dk/summa/search" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://statsbiblioteket.dk/summa/search" xmlns:intf="http://statsbiblioteket.dk/summa/search" 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:types>
  <schema elementFormDefault="qualified" targetNamespace="http://statsbiblioteket.dk/summa/search" xmlns="http://www.w3.org/2001/XMLSchema">
   <element name="simpleSearch">
    <complexType>
     <sequence>
      <element name="query" type="xsd:string"/>
      <element name="numberOfRecords" type="xsd:int"/>
      <element name="startIndex" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>
   <element name="simpleSearchResponse">
    <complexType>
     <sequence>
      <element name="simpleSearchReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="simpleSearchSorted">
    <complexType>
     <sequence>
      <element name="query" type="xsd:string"/>
      <element name="numberOfRecords" type="xsd:int"/>
      <element name="startIndex" type="xsd:int"/>
      <element name="sortKey" type="xsd:string"/>
      <element name="reverse" type="xsd:boolean"/>
     </sequence>
    </complexType>
   </element>
   <element name="simpleSearchSortedResponse">
    <complexType>
     <sequence>
      <element name="simpleSearchSortedReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
  </schema>
 </wsdl:types>
   <wsdl:message name="simpleSearchSortedRequest">
      <wsdl:part element="impl:simpleSearchSorted" name="parameters"/>
   </wsdl:message>
   <wsdl:message name="simpleSearchRequest">
      <wsdl:part element="impl:simpleSearch" name="parameters"/>
   </wsdl:message>
   <wsdl:message name="simpleSearchSortedResponse">
      <wsdl:part element="impl:simpleSearchSortedResponse" name="parameters"/>
   </wsdl:message>
   <wsdl:message name="simpleSearchResponse">
      <wsdl:part element="impl:simpleSearchResponse" name="parameters"/>
   </wsdl:message>
   <wsdl:portType name="SearchWS">
      <wsdl:operation name="simpleSearch">
   <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
                This method executes the given query and returns a search result ranked by relevancy.
                query: The query string.
                numberOfRecords: The maximum number of records returned in the search result.
                startIndex: The number of the first record to return.
               </wsdl:documentation>
         <wsdl:input message="impl:simpleSearchRequest" name="simpleSearchRequest"/>
         <wsdl:output message="impl:simpleSearchResponse" name="simpleSearchResponse"/>
      </wsdl:operation>
      <wsdl:operation name="simpleSearchSorted">
   <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
                This method executes the given query and returns a search result ranked by the given sort key.
                query: The query string.
                numberOfRecords: The maximum number of records returned in the search result.
                startIndex: The number of the first record to return.
                sortKey: The key to sort by.
                reverse: A boolean indication whether or not to sort in reverse.
               </wsdl:documentation>
         <wsdl:input message="impl:simpleSearchSortedRequest" name="simpleSearchSortedRequest"/>
         <wsdl:output message="impl:simpleSearchSortedResponse" name="simpleSearchSortedResponse"/>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="SearchWSSoapBinding" type="impl:SearchWS">
      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="simpleSearch">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="simpleSearchRequest">
            <wsdlsoap:body use="literal"/>
         </wsdl:input>
         <wsdl:output name="simpleSearchResponse">
            <wsdlsoap:body use="literal"/>
         </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="simpleSearchSorted">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="simpleSearchSortedRequest">
            <wsdlsoap:body use="literal"/>
         </wsdl:input>
         <wsdl:output name="simpleSearchSortedResponse">
            <wsdlsoap:body use="literal"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="SearchWSService">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
Search web service for the Summa system </wsdl:documentation>
      <wsdl:port binding="impl:SearchWSSoapBinding" name="SearchWS">
         <wsdlsoap:address location="http://localhost:8080/summa-web-search/services/SearchWS"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>
}}}
Content of this page:
 * [#operations Operations]
 * [#resultXML Result XML Definition]
 * [#example Result XML Example]

[[Anchor(operations)]]
== Operations ==

=== simpleSearch ===
This method executes the given query and returns a search result ranked by relevance.

Input parameters:
 * {{{String query}}} The query string.
 * {{{int numberOfRecords}}} The maximum number of records returned in search result.
 * {{{int startIndex}}} The number of the first record to return.

Returns:
 * {{{String simpleSearchReturn}}} The search result sorted by relevance as structured XML document. See [#resultXML definition] below.

Throws:
 * {{{java.rmi.RemoteException}}}

=== simpleSearchSorted ===
This method executes the given query and returns a search result ranked by the given sort key.

Input parameters:
 * {{{String query}}} The query string.
 * {{{int numberOfRecords}}} The maximum number of records returned in search result.
 * {{{int startIndex}}} The number of the first record to return.
 * {{{String sortKey}}} The key to sort by.
 * {{{boolean reverse}}} A boolean indication whether or not to sort in reverse.

Returns:
 * {{{String simpleSearchReturn}}} The search result sorted by the given key sort, reversed if so indicated, as structured XML document. See [#resultXML definition] below.

Throws:
 * {{{java.rmi.RemoteException}}}

[[Anchor(resultXML)]]
== Result XML ==

TODO
Line 185: Line 118:

[[Anchor(example)]]
== Result XML Example ==

Search API

DOMS Search uses simple search methods of the Summa Search interface.

WSDL: attachment:DomsGUISearch.wsdl

Content of this page:

  • [#operations Operations]
  • [#resultXML Result XML Definition]
  • [#example Result XML Example]

Anchor(operations)

Operations

simpleSearch

This method executes the given query and returns a search result ranked by relevance.

Input parameters:

  • String query The query string.

  • int numberOfRecords The maximum number of records returned in search result.

  • int startIndex The number of the first record to return.

Returns:

  • String simpleSearchReturn The search result sorted by relevance as structured XML document. See [#resultXML definition] below.

Throws:

  • java.rmi.RemoteException

simpleSearchSorted

This method executes the given query and returns a search result ranked by the given sort key.

Input parameters:

  • String query The query string.

  • int numberOfRecords The maximum number of records returned in search result.

  • int startIndex The number of the first record to return.

  • String sortKey The key to sort by.

  • boolean reverse A boolean indication whether or not to sort in reverse.

Returns:

  • String simpleSearchReturn The search result sorted by the given key sort, reversed if so indicated, as structured XML document. See [#resultXML definition] below.

Throws:

  • java.rmi.RemoteException

Anchor(resultXML)

Result XML

TODO

The result string is actually XML, in the following form:

<responsecollection>
<response name="DocumentResponse">
<documentresult query="Hans" startIndex="0" maxRecords="20"
sortKey="summa-score" reverseSort="false" fields="recordID, shortformat"
searchTime="105" hitCount="1">
  <record score="0.37572" id="0" source="NA">
    <field name="recordID">fagref:hj@example.com</field>
    <field name="shortformat">&amp;lt;shortrecord&amp;gt;
&amp;lt;rdf:RDF
xmlns:rdf=&amp;quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
&amp;lt;rdf:Description&amp;gt;
&amp;lt;dc:title&amp;gt;Fagekspert i Datalogi&amp;lt;/dc:title&amp;gt;
&amp;lt;dc:creator&amp;gt;Hans Jensen&amp;lt;/dc:creator&amp;gt;
&amp;lt;dc:type
xml:lang=&amp;quot;da&amp;quot;&amp;gt;person&amp;lt;/dc:type&amp;gt;
&amp;lt;dc:type
xml:lang=&amp;quot;en&amp;quot;&amp;gt;person&amp;lt;/dc:type&amp;gt;
&amp;lt;dc:identifier&amp;gt;hj@example.com&amp;lt;/dc:identifier&amp;gt;
&amp;lt;/rdf:Description&amp;gt;
&amp;lt;/rdf:RDF&amp;gt;
&amp;lt;/shortrecord&amp;gt;</field>
  </record>
</documentresult>
</response>
</responsecollection>

Currently, we don't have a schema for the result set.

The result can be read as follows:

documentresult element

  • Attributes query, startIndex, maxRecords, sortKey, reverseSort: Same as input to method
  • Attribute fields: Always "recordID, shortformat"
  • Attribute searchTime: Time it took to search
  • Attribute hitCount: Number of results

record element

  • Attribute score: value from 0 to 1 with relevancy ranking
  • Attributes id, name: Not used

field element

  • Attribute name: Always either recordID or shortformat
  • Contents are the PID for recordID, or XML for shortformat.

The format of the "shortformat" field is (decoded version of contents above):

<shortrecord>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description>
<dc:title>Fagekspert i Datalogi</dc:title>
<dc:creator>Hans Jensen</dc:creator>
<dc:type
xml:lang="da">person</dc:type>
<dc:type
xml:lang="en">person</dc:type>
<dc:identifier>hj@example.com</dc:identifier>
</rdf:Description>
</rdf:RDF>
</shortrecord>

Important elements are the "dc" fields. They will contain the actual results.

Anchor(example)

Result XML Example

Search API (last edited 2010-03-17 13:09:38 by localhost)