Commit f17ec0fb65a218b03ee534b93d79517f4877dab1
1 parent
459bd9fe
Fix sorting in searches and other sorts of partial queries.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4958 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
6 additions
and
0 deletions
lib/browse/PartialQuery.inc.php
| @@ -269,8 +269,11 @@ class SimpleSearchQuery extends PartialQuery { | @@ -269,8 +269,11 @@ class SimpleSearchQuery extends PartialQuery { | ||
| 269 | // | 269 | // |
| 270 | // we also leak like ---- here, since getting the score is ... fiddly. and expensive. | 270 | // we also leak like ---- here, since getting the score is ... fiddly. and expensive. |
| 271 | function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { | 271 | function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { |
| 272 | + $this->sDocumentJoinClause = $sJoinClause; | ||
| 273 | + $this->aDocumentJoinParams = $aJoinParams; | ||
| 272 | $aOptions = array( | 274 | $aOptions = array( |
| 273 | 'select' => 'DISTINCT D.id AS id', | 275 | 'select' => 'DISTINCT D.id AS id', |
| 276 | + 'join' => array($sJoinClause, $aJoinParams), | ||
| 274 | ); | 277 | ); |
| 275 | $res = $this->getQuery($aOptions); | 278 | $res = $this->getQuery($aOptions); |
| 276 | if (PEAR::isError($res)) { return array(); } | 279 | if (PEAR::isError($res)) { return array(); } |
| @@ -374,8 +377,11 @@ class BooleanSearchQuery extends PartialQuery { | @@ -374,8 +377,11 @@ class BooleanSearchQuery extends PartialQuery { | ||
| 374 | // | 377 | // |
| 375 | // we also leak like ---- here, since getting the score is ... fiddly. and expensive. | 378 | // we also leak like ---- here, since getting the score is ... fiddly. and expensive. |
| 376 | function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { | 379 | function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { |
| 380 | + $this->sDocumentJoinClause = $sJoinClause; | ||
| 381 | + $this->aDocumentJoinParams = $aJoinParams; | ||
| 377 | $aOptions = array( | 382 | $aOptions = array( |
| 378 | 'select' => 'DISTINCT D.id AS id', | 383 | 'select' => 'DISTINCT D.id AS id', |
| 384 | + 'join' => array($sJoinClause, $aJoinParams), | ||
| 379 | ); | 385 | ); |
| 380 | $res = $this->getQuery($aOptions); | 386 | $res = $this->getQuery($aOptions); |
| 381 | if (PEAR::isError($res)) { return array(); } | 387 | if (PEAR::isError($res)) { return array(); } |