$bDeDupe = isset($_GET['dedupe'])?(bool)$_GET['dedupe']:true;
$bReverseInPlan = false;
$iLimit = isset($_GET['limit'])?(int)$_GET['limit']:10;
+ $iOffset = isset($_GET['offset'])?(int)$_GET['offset']:0;
$iMaxRank = 20;
if ($iLimit > 100) $iLimit = 100;
}
else
{
- $aSearch['aAddress'][$aSearchTerm['word_id']] = $aSearchTerm['word_id'];
- if (!sizeof($aSearch['aName']))
+ if (sizeof($aSearch['aName']))
+ {
+ $aSearch['aAddress'][$aSearchTerm['word_id']] = $aSearchTerm['word_id'];
+ }
+ else
{
$aSearch['aName'][$aSearchTerm['word_id']] = $aSearchTerm['word_id'];
$aSearch['iNamePhrase'] = $iPhrase;
{
$iQueryLoop++;
// Must have a location term
- if (!sizeof($aSearch['aName']) && !sizeof($aSearch['aAddress']))
+ if (!sizeof($aSearch['aName']) && !sizeof($aSearch['aAddress'] && !$aSearch['fLon']))
{
if (!$bBoundingBoxSearch && !$aSearch['fLon']) continue;
if (!$aSearch['sClass']) continue;
$oDB->query($sSQL);
// Now they are indexed look for a house attached to a street we found
- $sSQL = "select place_id from placex where street_place_id in (".$sPlaceIDs.") and housenumber ~* E'".$sHouseNumberRegex."'";
+ $sSQL = "select place_id from placex where parent_place_id in (".$sPlaceIDs.") and housenumber ~* E'".$sHouseNumberRegex."'";
if (sizeof($aExcludePlaceIDs))
{
$sSQL .= " and place_id not in (".join(',',$aExcludePlaceIDs).")";
if (CONST_Debug) exit;
- include('.htlib/output/search-'.$sOutputFormat.'.php');
+ include(CONST_BasePath.'/lib/template/search-'.$sOutputFormat.'.php');