[search] Do not index duplicate entries.

This commit is contained in:
Yury Melnichek 2011-09-05 14:19:45 +02:00 committed by Alex Zolotarev
parent d9b3668a88
commit 3a20f250d5

View file

@ -115,6 +115,7 @@ void indexer::BuildSearchIndex(FeaturesVector const & featuresVector, Writer & w
vector<FeatureName> names;
featuresVector.ForEachOffset(FeatureInserter(names));
sort(names.begin(), names.end());
names.erase(unique(names.begin(), names.end()), names.end());
trie::Build(writer, names.begin(), names.end(),
trie::builder::MaxValueEdgeBuilder<MaxValueCalc>());
}