Changeset 830 for MDRepository/trunk/xquery/cmd-model.xqm
- Timestamp:
- 11/02/10 12:06:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MDRepository/trunk/xquery/cmd-model.xqm
r827 r830 71 71 API function searchRetrieve. 72 72 :) 73 declare function cmd-model:search-retrieve($cql-query as xs:string, $collections as xs:string+, $format as xs:string, $start-item as xs:integer, $end-item as xs:integer) as item()* { 74 let $collection := collection($cmd-model:cmdiMirrorPath), 75 $decoded-query := xdb:decode($cql-query), 73 declare function cmd-model:search-retrieve($xpath-query as xs:string, $collections as xs:string+, $format as xs:string, $start-item as xs:integer, $end-item as xs:integer) as item()* { 74 let $start-time := fn:current-dateTime(), 75 $collection := collection($cmd-model:cmdiMirrorPath), 76 $decoded-query := xdb:decode($xpath-query), 76 77 $sanitized-query := cmd-model:sanitize-query($decoded-query), 77 78 $results := … … 84 85 $result-seq := fn:subsequence($results, $start-item, $end-item), 85 86 $seq-count := fn:count($result-seq), 87 $end-time := fn:current-dateTime(), 86 88 $result-fragment := 87 89 <searchRetrieveResponse> 88 90 <numberOfRecords>{$result-count}</numberOfRecords> 89 <echoedSearchRetrieveRequest>{if ($decoded-query ne $sanitized-query) then "Rewritten to descendant-or-self::CMD" else $cql-query, $collections, $start-item, $end-item}</echoedSearchRetrieveRequest> 90 <diagnostics>{$seq-count}</diagnostics> 91 <echoedSearchRetrieveRequest>{if ($decoded-query ne $sanitized-query) then "Rewritten to descendant-or-self::CMD" else $xpath-query, $collections, $start-item, $end-item}</echoedSearchRetrieveRequest> 92 <extraResponseData> 93 <returnedRecords>{$seq-count}</returnedRecords> 94 <duration>{$end-time - $start-time}</duration> 95 </extraResponseData> 91 96 <records> 92 97 {$result-seq}
Note: See TracChangeset
for help on using the changeset viewer.