+ // 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']];
+ else if (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'] = $aResult['foundorder'] + 0.000001 * $aClassType[$aResult['class'].':'.$aResult['type']]['importance'];
+ }
+ else
+ {
+ $aResult['foundorder'] = $aResult['foundorder'] + 0.001;
+ }