diff options
author | vng <viktor.govako@gmail.com> | 2012-02-17 01:47:45 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:34:12 +0300 |
commit | 99b8b11f7fec6416ba69002e86e2fb705589a794 (patch) | |
tree | 221d0db0574c25589880dc16de45a26820b9e8bf /indexer | |
parent | c0d319f011efc7e37684112e16c927490b983282 (diff) |
[search] Process feature types like 2-level types (trim 3 level).
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/search_index_builder.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp index 911dd82aa2..7145c576e6 100644 --- a/indexer/search_index_builder.cpp +++ b/indexer/search_index_builder.cpp @@ -256,12 +256,18 @@ public: // add names of categories of the feature for (size_t i = 0; i < types.Size(); ++i) { + uint32_t type = types[i]; + + // Leave only 2 level of type - for example, do not distinguish: + // highway-primary-oneway or amenity-parking-fee. + ftype::TruncValue(type, 2); + // Do index only for visible types in mwm. - pair<int, int> const r = feature::DrawableScaleRangeForType(types[i]); + pair<int, int> const r = feature::DrawableScaleRangeForType(type); if (my::between_s(m_scales.first, m_scales.second, r.first) || my::between_s(m_scales.first, m_scales.second, r.second)) { - inserter.AddToken(search::CATEGORIES_LANG, search::FeatureTypeToString(types[i])); + inserter.AddToken(search::CATEGORIES_LANG, search::FeatureTypeToString(type)); } } } |