$iOp = Operator::NEAR; // near == in for the moment
if ($aSearchTerm['operator'] == '') {
- if (sizeof($this->aName)) {
+ if (sizeof($this->aName) || $this->oContext->isBoundedSearch()) {
$iOp = Operator::NAME;
}
$oSearch->iSearchRank += 2;
) {
if ($aSearchTerm['search_name_count'] + 1 < CONST_Max_Word_Frequency) {
$oSearch = clone $this;
- $oSearch->iSearchRank++;
+ $oSearch->iSearchRank += 2;
$oSearch->aAddress[$iWordID] = $iWordID;
$aNewSearches[] = $oSearch;
} else {
&& (!sizeof($this->aName) || $this->iNamePhrase == $iPhrase)
) {
$oSearch = clone $this;
- $oSearch->iSearchRank++;
+ $oSearch->iSearchRank += 2;
if (!sizeof($this->aName)) {
$oSearch->iSearchRank += 1;
}
if ($this->sHouseNumber) {
$sImportanceSQL = '- abs(26 - address_rank) + 3';
} else {
- $sImportanceSQL = '(CASE WHEN importance = 0 OR importance IS NULL THEN 0.75-(search_rank::float/40) ELSE importance END)';
+ $sImportanceSQL = '(CASE WHEN importance = 0 OR importance IS NULL THEN 0.75001-(search_rank::float/40) ELSE importance END)';
}
$sImportanceSQL .= $this->oContext->viewboxImportanceSQL('centroid');
$aOrder[] = "$sImportanceSQL DESC";