mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 02:47:59 +00:00
always ignore multi term partials in search
Partial terms should only ever consist of one word. Ignore any other, they are a leftover from inefficient word index builts.
This commit is contained in:
@@ -333,7 +333,9 @@ class SearchDescription
|
||||
public function extendWithPartialTerm($sToken, $oSearchTerm, $bStructuredPhrases, $iPhrase, $aFullTokens)
|
||||
{
|
||||
// Only allow name terms.
|
||||
if (!(is_a($oSearchTerm, '\Nominatim\Token\Word'))) {
|
||||
if (!(is_a($oSearchTerm, '\Nominatim\Token\Word'))
|
||||
|| strpos($sToken, ' ') !== false
|
||||
) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -361,7 +363,6 @@ class SearchDescription
|
||||
|
||||
if ((!$this->sPostcode && !$this->aAddress && !$this->aAddressNonSearch)
|
||||
&& ((empty($this->aName) && empty($this->aNameNonSearch)) || $this->iNamePhrase == $iPhrase)
|
||||
&& strpos($sToken, ' ') === false
|
||||
) {
|
||||
$oSearch = clone $this;
|
||||
$oSearch->iSearchRank++;
|
||||
|
||||
Reference in New Issue
Block a user