import v1.1.0_RC2 | 2009-09-20

This commit is contained in:
2019-07-17 22:19:00 +02:00
parent 3b7ba80568
commit 38c146901c
2504 changed files with 101817 additions and 62316 deletions

View File

@ -14,8 +14,9 @@
*
* @category Zend
* @package Zend_Search_Lucene
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Lucene.php 17164 2009-07-27 03:59:23Z matthew $
*/
/** Zend_Search_Lucene_Document */
@ -84,7 +85,7 @@ require_once 'Zend/Search/Lucene/Proxy.php';
/**
* @category Zend
* @package Zend_Search_Lucene
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Search_Lucene implements Zend_Search_Lucene_Interface
@ -951,6 +952,13 @@ class Zend_Search_Lucene implements Zend_Search_Lucene_Interface
$fieldNames = $this->getFieldNames();
$sortArgs = array();
// PHP 5.3 now expects all arguments to array_multisort be passed by
// reference; since constants can't be passed by reference, create
// some placeholder variables.
$sortReg = SORT_REGULAR;
$sortAsc = SORT_ASC;
$sortNum = SORT_NUMERIC;
require_once 'Zend/Search/Lucene/Exception.php';
for ($count = 1; $count < count($argList); $count++) {
$fieldName = $argList[$count];
@ -978,32 +986,32 @@ class Zend_Search_Lucene implements Zend_Search_Lucene_Interface
$valuesArray[] = $value;
}
$sortArgs[] = $valuesArray;
$sortArgs[] = &$valuesArray;
if ($count + 1 < count($argList) && is_integer($argList[$count+1])) {
$count++;
$sortArgs[] = $argList[$count];
$sortArgs[] = &$argList[$count];
if ($count + 1 < count($argList) && is_integer($argList[$count+1])) {
$count++;
$sortArgs[] = $argList[$count];
$sortArgs[] = &$argList[$count];
} else {
if ($argList[$count] == SORT_ASC || $argList[$count] == SORT_DESC) {
$sortArgs[] = SORT_REGULAR;
$sortArgs[] = &$sortReg;
} else {
$sortArgs[] = SORT_ASC;
$sortArgs[] = &$sortAsc;
}
}
} else {
$sortArgs[] = SORT_ASC;
$sortArgs[] = SORT_REGULAR;
$sortArgs[] = &$sortAsc;
$sortArgs[] = &$sortReg;
}
}
// Sort by id's if values are equal
$sortArgs[] = $ids;
$sortArgs[] = SORT_ASC;
$sortArgs[] = SORT_NUMERIC;
$sortArgs[] = &$ids;
$sortArgs[] = &$sortAsc;
$sortArgs[] = &$sortNum;
// Array to be sorted
$sortArgs[] = &$hits;