Changes between Version 64 and Version 65 of Taskforces/FCS/FCS-Specification-Draft


Ignore:
Timestamp:
06/13/17 14:14:10 (7 years ago)
Author:
Leif-Jöran
Comment:

Adding operation=searchRetrieve 2.0 example querytype=cql in addition to the queryType=fcs one

Legend:

Unmodified
Added
Removed
Modified
  • Taskforces/FCS/FCS-Specification-Draft

    v64 v65  
    989989}}}
    990990
    991 Moving to a SRU 2.0 example which shows a request and response to a ''searchRetrieve'' request with a ''queryType=fcs'' query for ''[word = "användning"]'':
     991Moving to a SRU 2.0. We introduce the `queryType` parameter. The same query would then become:
     992* HTTP GET request: Client → Endpoint:
     993{{{#!sh
     994http://localhost:8080/korp-endpoint/sru?operation=searchRetrieve&queryType=cql&query=%22anv%C3%A4ndning%22
     995}}}
     996* HTTP Response: Endpoint → Client:
     997{{{#!xml
     998<?xml version='1.0' encoding='utf-8'?>
     999<sruResponse:searchRetrieveResponse>
     1000  <sruResponse:version>2.0</sruResponse:version>
     1001  <sruResponse:numberOfRecords>33260</sruResponse:numberOfRecords>
     1002  <sruResponse:records>
     1003    <sruResponse:record>
     1004      <sruResponse:recordSchema>http://clarin.eu/fcs/resource</sruResponse:recordSchema>
     1005      <sruResponse:recordXMLEscaping>xml</sruResponse:recordXMLEscaping>
     1006      <sruResponse:recordData>
     1007        <fcs:Resource pid="ABOUNDERRATTELSER2012-32245">
     1008          <fcs:ResourceFragment>
     1009            <fcs:DataView type="application/x-clarin-fcs-hits+xml">
     1010              <hits:Result>Youtube-videon har väckt debatt om polisernas <hits:Hit>användning</hits:Hit> av våld .</hits:Result>
     1011            </fcs:DataView>
     1012          </fcs:ResourceFragment>
     1013        </fcs:Resource>
     1014      </sruResponse:recordData>
     1015      <sruResponse:recordPosition>1</sruResponse:recordPosition>
     1016    </sruResponse:record>
     1017    <!-- 249 records not shown -->
     1018  </sruResponse:records>
     1019  <sruResponse:nextRecordPosition>251</sruResponse:nextRecordPosition>
     1020  <sruResponse:echoedSearchRetrieveRequest>
     1021  <sruResponse:version>2.0</sruResponse:version>
     1022  <sruResponse:query>"användning"</sruResponse:query>
     1023  <sruResponse:xQuery>
     1024    <searchClause>
     1025      <index>cql.serverChoice</index>
     1026      <relation><value>=</value></relation>
     1027      <term>användning</term>
     1028    </searchClause>
     1029  </sruResponse:xQuery>
     1030  <sruResponse:startRecord>1</sruResponse:startRecord>
     1031</sruResponse:echoedSearchRetrieveRequest>
     1032<sruResponse:resultCountPrecision>info:srw/vocabulary/resultCountPrecision/1/exact</sruResponse:resultCountPrecision>
     1033</sruResponse:searchRetrieveResponse>
     1034}}}
     1035
     1036And for ''queryType'' with value ''fcs'' using FCS-QL we get a request and response to the ''searchRetrieve'' request with queryType ''fcs'' and query ''[word = "användning"]'':
    9921037* HTTP GET request: Client → Endpoint:
    9931038{{{#!sh
     
    10761121  <sruResponse:startRecord>1</sruResponse:startRecord>
    10771122</sruResponse:echoedSearchRetrieveRequest>
    1078 <sruResponse:resultCountPrecision>info:srw/vocabulary/resultCountPrecision/1/exact</sruResponse:resultCountPrecision></sruResponse:searchRetrieveResponse>
     1123<sruResponse:resultCountPrecision>info:srw/vocabulary/resultCountPrecision/1/exact</sruResponse:resultCountPrecision>
     1124</sruResponse:searchRetrieveResponse>
    10791125}}}
    10801126