Fix #6240
This commit is contained in:
parent
4e651f8164
commit
91e9b9e9cb
2 changed files with 12 additions and 4 deletions
|
@ -354,7 +354,7 @@ public class SearchCoreFactory {
|
|||
|
||||
private void searchByName(final SearchPhrase phrase, final SearchResultMatcher resultMatcher)
|
||||
throws IOException {
|
||||
if (phrase.getRadiusLevel() > 1 || phrase.getUnknownSearchWordLength() > 3 || phrase.getUnknownSearchWords().size() > 0) {
|
||||
if (phrase.getRadiusLevel() > 1 || phrase.getUnknownSearchWordLength() > 3 || phrase.getUnknownSearchWords().size() > 0 || phrase.isSearchTypeAllowed(ObjectType.POSTCODE, true)) {
|
||||
final boolean locSpecified = phrase.getLastTokenLocation() != null;
|
||||
LatLon loc = phrase.getLastTokenLocation();
|
||||
final List<SearchResult> immediateResults = new ArrayList<>();
|
||||
|
|
|
@ -422,10 +422,18 @@ public class SearchPhrase {
|
|||
}
|
||||
|
||||
public boolean isSearchTypeAllowed(ObjectType searchType) {
|
||||
if (getSearchTypes() == null) {
|
||||
return true;
|
||||
return isSearchTypeAllowed(searchType, false);
|
||||
}
|
||||
|
||||
public boolean isSearchTypeAllowed(ObjectType searchType, boolean exclusive) {
|
||||
ObjectType[] searchTypes = getSearchTypes();
|
||||
if (searchTypes == null) {
|
||||
return !exclusive;
|
||||
} else {
|
||||
for (ObjectType type : getSearchTypes()) {
|
||||
if (exclusive && searchTypes.length > 1) {
|
||||
return false;
|
||||
}
|
||||
for (ObjectType type : searchTypes) {
|
||||
if (type == searchType) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue