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:
Sarah Hoffmann
2021-05-23 22:13:03 +02:00
parent 10143e0ac7
commit 02f6afa51b

View File

@@ -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++;