| 653 | } |
| 654 | |
| 655 | void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter) |
| 656 | { |
| 657 | using Key = strings::UniString; |
| 658 | using Value = Uint64IndexValue; |
| 659 | |
| 660 | LOG(LINFO, ("Start building search index for", container.GetFileName())); |
| 661 | base::Timer timer; |
| 662 | |
| 663 | auto const & categoriesHolder = GetDefaultCategories(); |
| 664 | |
| 665 | FeaturesVectorTest features(container); |
| 666 | SingleValueSerializer<Value> serializer; |
| 667 | |
| 668 | std::vector<std::pair<Key, Value>> searchIndexKeyValuePairs; |
| 669 | AddFeatureNameIndexPairs(features, categoriesHolder, searchIndexKeyValuePairs); |
| 670 | |
| 671 | std::sort(searchIndexKeyValuePairs.begin(), searchIndexKeyValuePairs.end()); |
| 672 | LOG(LINFO, ("End sorting strings:", timer.ElapsedSeconds())); |
| 673 | |
| 674 | trie::Build<Writer, Key, ValueList<Value>, SingleValueSerializer<Value>>(indexWriter, serializer, |
| 675 | searchIndexKeyValuePairs); |
| 676 | |
| 677 | LOG(LINFO, ("End building search index, elapsed seconds:", timer.ElapsedSeconds())); |
| 678 | } |
| 679 | } // namespace indexer |
no test coverage detected