Difference between revisions of "DPL Example 027"

From FollowTheScore
Jump to: navigation, search
Line 9: Line 9:
 
* This criterion is set by an URL parameter which is deducted from information of the previous query: each query passes the first and last page of its result set to a [[Template:Extension DPL continue|scroll helper template]].
 
* This criterion is set by an URL parameter which is deducted from information of the previous query: each query passes the first and last page of its result set to a [[Template:Extension DPL continue|scroll helper template]].
 
* The approach could be extended: The scroll helper could produce a set of fixed links for the initial letters; thus one could easily jump to A, B, C, ...  
 
* The approach could be extended: The scroll helper could produce a set of fixed links for the initial letters; thus one could easily jump to A, B, C, ...  
* For convenience we repeat the last page of a result set as the first page of the next result set. Watch how the number of "remaining pages" goes up by 1 each time we scroll.
+
* For convenience we repeat the last page of a result set as the first page of the next result set.  
 
* Expert users can add &DPL_count=... to the URL to get a larger result set (within the configuration limits)
 
* Expert users can add &DPL_count=... to the URL to get a larger result set (within the configuration limits)
 +
* note that adding %TOTALPAGES% to ''resultsheader'' or ''resultsfooter'' would lead to a SQL statement which might be less efficient as the database must calculate the totla number of matching records ("SQL_CALC_FOUND_ROWS")
  
 
{{#dpl:
 
{{#dpl:
Line 17: Line 18:
 
| redirects          = include
 
| redirects          = include
 
| count              = {%DPL_count:50%}
 
| count              = {%DPL_count:50%}
| resultsheader      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=%TOTALPAGES%¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
+
| resultsheader      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
| resultsfooter      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=%TOTALPAGES%¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
+
| resultsfooter      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
 
}}
 
}}
 
<pre><nowiki>
 
<pre><nowiki>
Line 25: Line 26:
 
| redirects          = include
 
| redirects          = include
 
| count              = {%DPL_count:50%}
 
| count              = {%DPL_count:50%}
| resultsheader      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=%TOTALPAGES%¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
+
| resultsheader      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
| resultsfooter      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=%TOTALPAGES%¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
+
| resultsfooter      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
 
}}</nowiki></pre>
 
}}</nowiki></pre>

Revision as of 08:04, 25 June 2009

back to list of examples

Optimum performance result scrolling for huge wikis

This page demonstrates how DPL can be used in really huge wikis like WIKIPEDIA to allow efficient scrolling through huge result sets. The approach ios very much straight forward:

  • We use count=50
  • When scrolling forward we use ascending order
  • When scrolling backward we internally use descending order but we reverse the result set for the user
  • Each query takes a lower or an upper limit for the search as a selection criterion
  • This criterion is set by an URL parameter which is deducted from information of the previous query: each query passes the first and last page of its result set to a scroll helper template.
  • The approach could be extended: The scroll helper could produce a set of fixed links for the initial letters; thus one could easily jump to A, B, C, ...
  • For convenience we repeat the last page of a result set as the first page of the next result set.
  • Expert users can add &DPL_count=... to the URL to get a larger result set (within the configuration limits)
  • note that adding %TOTALPAGES% to resultsheader or resultsfooter would lead to a SQL statement which might be less efficient as the database must calculate the totla number of matching records ("SQL_CALC_FOUND_ROWS")
startbacknext(50 listedExpression error: Unexpected > operator.)
startbacknext(50 listedExpression error: Unexpected > operator.)
{{#dpl:
| namespace          =
| redirects          = include
| count              = {%DPL_count:50%}
| resultsheader      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
| resultsfooter      = ²{Extension DPL continue¦dir=%SCROLLDIR%¦pages=%PAGES%¦total=¦firsttitle=%FIRSTTITLE%¦lasttitle=%LASTTITLE%¦page={{PAGENAME}}}²\n
}}