mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 05:14:07 +00:00
second attempt at strict names in structured queries
If a term does not go into names it should go into address terms.
This commit is contained in:
@@ -276,11 +276,12 @@ class SearchDescription
|
|||||||
&& $sPhraseType != 'country'
|
&& $sPhraseType != 'country'
|
||||||
) {
|
) {
|
||||||
$iWordID = $aSearchTerm['word_id'];
|
$iWordID = $aSearchTerm['word_id'];
|
||||||
if (sizeof($this->aName)) {
|
// Full words can only be a name if they appear at the beginning
|
||||||
if (($sPhraseType == '' || !$bFirstPhrase)
|
// of the phrase. In structured search the name must forcably in
|
||||||
&& $sPhraseType != 'country'
|
// the first phrase. In unstructured search it may be in a later
|
||||||
&& !$bHasPartial
|
// phrase when the first phrase is a house number.
|
||||||
) {
|
if (sizeof($this->aName) || !($bFirstPhrase || $sPhraseType == '')) {
|
||||||
|
if (($sPhraseType == '' || !$bFirstPhrase) && !$bHasPartial) {
|
||||||
$oSearch = clone $this;
|
$oSearch = clone $this;
|
||||||
$oSearch->iSearchRank++;
|
$oSearch->iSearchRank++;
|
||||||
$oSearch->aAddress[$iWordID] = $iWordID;
|
$oSearch->aAddress[$iWordID] = $iWordID;
|
||||||
@@ -289,14 +290,10 @@ class SearchDescription
|
|||||||
$this->aFullNameAddress[$iWordID] = $iWordID;
|
$this->aFullNameAddress[$iWordID] = $iWordID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// in structured search only the first phrase can be the
|
$oSearch = clone $this;
|
||||||
// designated name
|
$oSearch->iSearchRank++;
|
||||||
if ($sPhraseType == '' || $bFirstPhrase) {
|
$oSearch->aName = array($iWordID => $iWordID);
|
||||||
$oSearch = clone $this;
|
$aNewSearches[] = $oSearch;
|
||||||
$oSearch->iSearchRank++;
|
|
||||||
$oSearch->aName = array($iWordID => $iWordID);
|
|
||||||
$aNewSearches[] = $oSearch;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user