~zhangew401/scope-aggregator/fix-empty-query-to-clickstore

« back to all changes in this revision

Viewing changes to src/query.cpp

  • Committer: Kyle Nitzsche
  • Date: 2015-11-30 17:08:54 UTC
  • mfrom: (154.1.1 ota8-nearby-places-bug)
  • Revision ID: kyle.nitzsche@canonical.com-20151130170854-58ab4kwk8yw46pau
Tags: 4.1
Release 4.1.

Merge branch that fixes bug lp:1518346 in scope-agg. (nearby scope needs the .so 
and a new release: 4.1.0). 

This bug comes from the specific use case (not before encountered) where an
agg scope includes a single child scope multiple times through multiple 
"order" > "keyword" objects. The fix includes proper handling of scope id
and local_id for this case, including related data structures. 

(This fix and the bug do not relate to the
case of keyword aggregation when using "category" objects,
so the following is not related and works fine: 

"order" > "category" > "keyword".)

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
    int idx = -1;//used in scopes_m_int_localId to store scope local_id
289
289
    for (const std::string &local_id : scopes_ordered)
290
290
    {
 
291
        qDebug() << "==== handle. checking scope locali_id: " << qstr(local_id);
 
292
        qDebug() << "==== handle. checking scope id: " << qstr(localId_id_m[local_id]);
291
293
        // get a pointer to the current child scope (by id from the map)
292
294
        std::shared_ptr<AggChildScope> scope = scopes_m[local_id];
293
295