hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SphinxResultTransformer.cpp
Go to the documentation of this file.
2 
3 namespace HCE
4 {
5 namespace sphinx
6 {
7 namespace reduce_task
8 {
10 {
11 }
12 
14 {
15 }
16 
18  const Poco::SharedPtr<SphinxResultData> &sphinxResultData,
19  std::vector<std::pair<std::string, unsigned long long> > &extractedWeightKeys)
20 {
21  extractedWeightKeys.clear();
22  extractWeightKeyPaisFromResultData(sphinxResultData, extractedWeightKeys);
23 }
24 
25 void SphinxResultTransformer::extractWeightKeyPaisFromResultData(
26  const Poco::SharedPtr<SphinxResultData> &sphinxResultData,
27  std::vector<std::pair<std::string, unsigned long long> > &extractedWeightKeys)
28 {
29  size_t totalMatchInfoNumber = sphinxResultData->getMatchInfoCount();
30  for (size_t matchInfoIndex =0; matchInfoIndex < totalMatchInfoNumber;
31  ++matchInfoIndex){
32  SphinxMatchInfo matchInfo = sphinxResultData->getMatchInfoItem(matchInfoIndex);
33  extractedWeightKeys.push_back(make_pair(matchInfo.getWeight(), matchInfo.getDocId()));
34  }
35 }
36 
37 
38 }
39 }
40 }