Improved search for OSM Live
This commit is contained in:
parent
b9a6571527
commit
b730a4bee3
1 changed files with 7 additions and 0 deletions
|
@ -38,12 +38,14 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
|
||||
|
@ -486,6 +488,7 @@ public class SearchCoreFactory {
|
|||
SearchPhraseDataType.POI);
|
||||
final NameStringMatcher nm = phrase.getNameStringMatcher();
|
||||
QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS_INSIDE);
|
||||
final Set<Long> ids = new HashSet();
|
||||
SearchRequest<Amenity> req = BinaryMapIndexReader.buildSearchPoiRequest(
|
||||
(int)bbox.centerX(), (int)bbox.centerY(),
|
||||
phrase.getUnknownSearchWord(),
|
||||
|
@ -498,6 +501,9 @@ public class SearchCoreFactory {
|
|||
if (limit ++ > LIMIT) {
|
||||
return false;
|
||||
}
|
||||
if (ids.contains(object.getId())) {
|
||||
object.setName(object.getName() + " (closed)");
|
||||
}
|
||||
SearchResult sr = new SearchResult(phrase);
|
||||
sr.otherNames = object.getAllNames(true);
|
||||
sr.localeName = object.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate());
|
||||
|
@ -523,6 +529,7 @@ public class SearchCoreFactory {
|
|||
phrase.countUnknownWordsMatch(sr);
|
||||
sr.objectType = ObjectType.POI;
|
||||
resultMatcher.publish(sr);
|
||||
ids.add(object.getId());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue