Changeset 2197


Ignore:
Timestamp:
21/02/07 12:40:22 (12 years ago)
Author:
mpritcha
Message:

Fixed slow response due to unnecessary use of <document> wrappers in intermediate result sets within xquery.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/trunk/ws-Discovery2/src/ndg/services/discovery/SearchAgent.java

    r2106 r2197  
    559559"   let $s_result := ( \n"+ 
    560560"       for $j in $result/sql:row/id/text() \n"+ 
    561 "       return <document>{$j}</document> \n"+ 
     561"       return $j \n"+ 
    562562"   ) \n"+ 
    563563"   return $s_result \n"+ 
     
    567567"   let $result := __subst_term__ \n"+ 
    568568"   for $i in $result \n"+ 
    569 "      return <document>{util:document-name($i)}</document> \n"+ 
     569"      return util:document-name($i) \n"+ 
    570570"}; \n"+ 
    571571"declare function local:mergeResults($arg1 as item()*, $arg2 as item()*) as item()* { \n"+ 
    572 "   for $i in $arg1[./text()=$arg2/text()] \n"+ 
    573 "   return <document>{$i/text()}</document> \n"+ 
     572"   for $i in $arg1[.=$arg2] \n"+ 
     573"   return $i \n"+ 
    574574"}; \n"+ 
    575575"declare function local:filterByScope($arg1 as item()*) as item()* { \n"+ 
     
    577577"      for $i in $arg1 \n"+ 
    578578"       let $coll := '/db/discovery/moles' \n"+ 
    579 "       let $thisdoc := $i/text() \n"+ 
     579"       let $thisdoc := $i \n"+ 
    580580"       let $name := string-join( ($coll , $thisdoc), '/' ) \n"+ 
    581581"       let $molesdoc := document( $name ) \n"+ 
     
    590590"         for $i in $arg1 \n"+ 
    591591"         let $coll := '/db/discovery/moles' \n"+ 
    592 "         let $thisdoc := $i/text() \n"+ 
     592"         let $thisdoc := $i \n"+ 
    593593"         let $name := string-join( ($coll , $thisdoc), '/' ) \n"+ 
    594594"         order by document($name)/dgMetadata/dgMetadataRecord/dgDataEntity/dgDataSummary/dgDataCoverage/dgTemporalCoverage/DateRange/DateRangeStart descending \n"+ 
     
    598598"         for $i in $arg1 \n"+ 
    599599"         let $coll := '/db/discovery/moles' \n"+ 
    600 "         let $thisdoc := $i/text() \n"+ 
     600"         let $thisdoc := $i \n"+ 
    601601"         let $name := string-join( ($coll , $thisdoc), '/' ) \n"+ 
    602602"         order by document($name)/dgMetadata/dgMetadataRecord/dgDataEntity/dgDataSummary/dgDataCoverage/dgTemporalCoverage/DateRange/DateRangeStart ascending \n"+ 
     
    641641"}; \n"+ 
    642642"for $i in local:buildResult() \n"+ 
    643 "return $i \n"; 
     643"return <document>{$i}</document> \n"; 
    644644 
    645645} 
Note: See TracChangeset for help on using the changeset viewer.