- $aResult['name'] = $aResult['langaddress'];
- // secondary ordering (for results with same importance (the smaller the better):
- // - approximate importance of address parts
- $aResult['foundorder'] = -$aResult['addressimportance']/10;
- // - number of exact matches from the query
- if (isset($this->exactMatchCache[$aResult['place_id']])) {
- $aResult['foundorder'] -= $this->exactMatchCache[$aResult['place_id']];
- } elseif (isset($this->exactMatchCache[$aResult['parent_place_id']])) {
- $aResult['foundorder'] -= $this->exactMatchCache[$aResult['parent_place_id']];
- }
- // - importance of the class/type
- if (isset($aClassType[$aResult['class'].':'.$aResult['type']]['importance'])
- && $aClassType[$aResult['class'].':'.$aResult['type']]['importance']
- ) {
- $aResult['foundorder'] += 0.0001 * $aClassType[$aResult['class'].':'.$aResult['type']]['importance'];
- } else {
- $aResult['foundorder'] += 0.01;
+ // secondary ordering (for results with same importance (the smaller the better):
+ // - approximate importance of address parts
+ $aResult['foundorder'] = -$aResult['addressimportance']/10;
+ // - number of exact matches from the query
+ if (isset($this->exactMatchCache[$aResult['place_id']])) {
+ $aResult['foundorder'] -= $this->exactMatchCache[$aResult['place_id']];
+ } elseif (isset($this->exactMatchCache[$aResult['parent_place_id']])) {
+ $aResult['foundorder'] -= $this->exactMatchCache[$aResult['parent_place_id']];
+ }
+ // - importance of the class/type
+ if (isset($aClassType[$aResult['class'].':'.$aResult['type']]['importance'])
+ && $aClassType[$aResult['class'].':'.$aResult['type']]['importance']
+ ) {
+ $aResult['foundorder'] += 0.0001 * $aClassType[$aResult['class'].':'.$aResult['type']]['importance'];
+ } else {
+ $aResult['foundorder'] += 0.01;
+ }