995 | | In general, the Endpoint is `REQUIRED` to accept an ''unrestricted search'' and `SHOULD` perform the search operation on ''all'' Resources that are available at the Endpoint. If that is for some reason not feasible, e.g. performing an unrestricted search would allocate too many resources, the Endpoint `MAY` independently restrict the search to a scope that it can handle. If it does so, it `MUST` issue a non-fatal diagnostics `http://clarin.eu/fcs/diagnostic/2` ("Resource set too large. Query context automatically adjusted."). The details field of diagnostics `MUST` contain the persistent identifier of the resources to which the query scope was limited to. If the Endpoint limits the query scope to more than one resource, it `MUST` generate a ''separate'' non-fatal diagnostic `http://clarin.eu/fcs/diagnostic/2` for each of the resources. |
| 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"]'': |
| 992 | * HTTP GET request: Client → Endpoint: |
| 993 | {{{#!sh |
| 994 | http://localhost:8080/korp-endpoint/sru?operation=searchRetrieve&queryType=fcs&query=%5bword%3d%22anv%C3%A4ndning%22%5d&x-cmd-resource-info=true |
| 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:DataView type="application/x-clarin-fcs-adv+xml"> |
| 1013 | <adv:Advanced unit="item"> |
| 1014 | <adv:Segments> |
| 1015 | <adv:Segment id="s1" start="1" end="15"/> |
| 1016 | <adv:Segment id="s2" start="16" end="19"/> |
| 1017 | <adv:Segment id="s3" start="20" end="25"/> |
| 1018 | <adv:Segment id="s4" start="26" end="32"/> |
| 1019 | <adv:Segment id="s5" start="33" end="35"/> |
| 1020 | <adv:Segment id="s6" start="36" end="46"/> |
| 1021 | <adv:Segment id="s7" start="47" end="57"/> |
| 1022 | <adv:Segment id="s8" start="58" end="60"/> |
| 1023 | <adv:Segment id="s9" start="61" end="65"/> |
| 1024 | <adv:Segment id="sa" start="66" end="67"/> |
| 1025 | </adv:Segments> |
| 1026 | <adv:Layers> |
| 1027 | <adv:Layer id="http://spraakbanken.gu.se/ns/fcs/layer/lemma"> |
| 1028 | <adv:Span ref="s1">|</adv:Span> |
| 1029 | <adv:Span ref="s2">|ha|</adv:Span> |
| 1030 | <adv:Span ref="s3">|väcka|</adv:Span> |
| 1031 | <adv:Span ref="s4">|debatt|</adv:Span> |
| 1032 | <adv:Span ref="s5">|om|</adv:Span> |
| 1033 | <adv:Span ref="s6">|polis|</adv:Span> |
| 1034 | <adv:Span ref="s7" highlight="h1">|användning|</adv:Span> |
| 1035 | <adv:Span ref="s8">|av|</adv:Span> |
| 1036 | <adv:Span ref="s9">|våld|</adv:Span> |
| 1037 | <adv:Span ref="sa">|</adv:Span> |
| 1038 | </adv:Layer> |
| 1039 | <adv:Layer id="http://spraakbanken.gu.se/ns/fcs/layer/word"> |
| 1040 | <adv:Span ref="s1">Youtube-videon</adv:Span> |
| 1041 | <adv:Span ref="s2">har</adv:Span> |
| 1042 | <adv:Span ref="s3">väckt</adv:Span> |
| 1043 | <adv:Span ref="s4">debatt</adv:Span> |
| 1044 | <adv:Span ref="s5">om</adv:Span> |
| 1045 | <adv:Span ref="s6">polisernas</adv:Span> |
| 1046 | <adv:Span ref="s7" highlight="h1">användning</adv:Span> |
| 1047 | <adv:Span ref="s8">av</adv:Span> |
| 1048 | <adv:Span ref="s9">våld</adv:Span> |
| 1049 | <adv:Span ref="sa">.</adv:Span> |
| 1050 | </adv:Layer> |
| 1051 | <adv:Layer id="http://spraakbanken.gu.se/ns/fcs/layer/pos"> |
| 1052 | <adv:Span ref="s1">PROPN</adv:Span> |
| 1053 | <adv:Span ref="s2">VERB</adv:Span> |
| 1054 | <adv:Span ref="s3">VERB</adv:Span> |
| 1055 | <adv:Span ref="s4">NOUN</adv:Span> |
| 1056 | <adv:Span ref="s5">ADP</adv:Span> |
| 1057 | <adv:Span ref="s6">NOUN</adv:Span> |
| 1058 | <adv:Span ref="s7" highlight="h1">NOUN</adv:Span> |
| 1059 | <adv:Span ref="s8">ADP</adv:Span> |
| 1060 | <adv:Span ref="s9">NOUN</adv:Span> |
| 1061 | <adv:Span ref="sa">PUNCT</adv:Span> |
| 1062 | </adv:Layer> |
| 1063 | </adv:Layers> |
| 1064 | </adv:Advanced> |
| 1065 | </fcs:DataView> |
| 1066 | </fcs:ResourceFragment> |
| 1067 | </fcs:Resource> |
| 1068 | </sruResponse:recordData> |
| 1069 | <sruResponse:recordPosition>1</sruResponse:recordPosition> |
| 1070 | </sruResponse:record> |
| 1071 | <!-- 249 records not shown --> |
| 1072 | </sruResponse:records> |
| 1073 | <sruResponse:nextRecordPosition>251</sruResponse:nextRecordPosition> |
| 1074 | <sruResponse:echoedSearchRetrieveRequest> |
| 1075 | <sruResponse:version>2.0</sruResponse:version> |
| 1076 | <sruResponse:startRecord>1</sruResponse:startRecord> |
| 1077 | </sruResponse:echoedSearchRetrieveRequest> |
| 1078 | <sruResponse:resultCountPrecision>info:srw/vocabulary/resultCountPrecision/1/exact</sruResponse:resultCountPrecision></sruResponse:searchRetrieveResponse> |
| 1079 | }}} |
| 1080 | |
| 1081 | In general, as you can se from both the SRU 1.2 and SRU 2.0 examples above, the Endpoint is `REQUIRED` to accept an ''unrestricted search'' and `SHOULD` perform the search operation on ''all'' Resources that are available at the Endpoint. If that is for some reason not feasible, e.g. performing an unrestricted search would allocate too many resources, the Endpoint `MAY` independently restrict the search to a scope that it can handle. If it does so, it `MUST` issue a non-fatal diagnostics `http://clarin.eu/fcs/diagnostic/2` ("Resource set too large. Query context automatically adjusted."). The details field of diagnostics `MUST` contain the persistent identifier of the resources to which the query scope was limited to. If the Endpoint limits the query scope to more than one resource, it `MUST` generate a ''separate'' non-fatal diagnostic `http://clarin.eu/fcs/diagnostic/2` for each of the resources. |