Scopes scope is reordering results sent by the server

Bug #1312887 reported by Roberto Alsina
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity Scopes Scope
Fix Released
Critical
James Henstridge
unity-scope-scopes (Ubuntu)
Fix Released
Critical
James Henstridge

Bug Description

It's showing the actual scopes recommendations, which are the most important results, at the end, below "related searches", when the server is actually sending them first.

Tags: s-s-scopes

Related branches

tags: added: s-s-scopes
Michal Hruby (mhr3)
Changed in unity-scope-scopes:
assignee: nobody → James Henstridge (jamesh)
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Henstridge (jamesh) wrote :

So the execution flow when processing a search in the scope goes something like this:

1. issue the query to the remote scopes scope, with a time limit of 1 second.
2. If the remote scope answers in that time, iterate through the results and:
    - if the result is in the "recommendations" category, save it in recommended_scopes
    - otherwise, push it out immediately.
3. Iterate through the local scopes, and push a result if (a) the name matches, (b) the description matches, or (c) there was a recommendation for the scope. In case (c), all recommendations for the scope are pushed.
4. If the online scope did not return results in the 1 second time limit, wait for it to complete now.
5. Now perform the equivalent of (2) and (3) but ignore recommendations for scopes that have already been pushed out.

It looks like we can get the desired behaviour by saving the non-recommendations results from (2) and pushing them to the shell after (3), and do something similar in (5).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-scope-scopes - 0.1+14.10.20140521.2-0ubuntu1

---------------
unity-scope-scopes (0.1+14.10.20140521.2-0ubuntu1) utopic; urgency=low

  [ James Henstridge ]
  * Save non-recommendations online results, and push them out after
    merging the recommendations with local scopes results. (LP:
    #1312887)

  [ Pawel Stolowski ]
  * Use background value from appearance attributes exposed in
    ScopeMetadata. Requires latest scopes-api. (LP: #1319712)
  * Don't use scope_id, search_query and scope_department from the
    result anymore, use canned query returned by the server. Don't set
    interception flag on the results, as they can now be directly
    activated by the shell. (LP: #1321728)
 -- Ubuntu daily release <email address hidden> Wed, 21 May 2014 15:32:43 +0000

Changed in unity-scope-scopes (Ubuntu):
status: New → Fix Released
Revision history for this message
Facundo Batista (facundo) wrote :

This is still not fixed. As the bug title says, the problem here is that "Scopes scope is reordering results sent by the server".

See for example what happens now:

  http://tinypic.com/view.php?pic=30rocg2&s=8#.U335j4azgd8

The recommendations are *before* the main result!!

So, if results aren't re-ordered, all is fine. The fix should be to stop changing the order.

Thanks

Changed in unity-scope-scopes (Ubuntu):
status: Fix Released → Confirmed
Changed in unity-scope-scopes:
importance: Medium → High
Changed in unity-scope-scopes (Ubuntu):
importance: Undecided → High
Changed in unity-scope-scopes:
importance: High → Critical
Changed in unity-scope-scopes (Ubuntu):
importance: High → Critical
Revision history for this message
James Henstridge (jamesh) wrote :

Due to the way the scope is implemented (e.g. the fact that it is designed to return some results early if the remote scope is too slow in replying), there is always going to be the possibility of some reordering. So simply complaining that reordering has taken place is not that helpful.

I've proposed a second branch that tweaks the algorithm a bit further. Could you check to see whether this does the job? It doesn't hard code knowledge of any new categories, so shouldn't place any new restrictions on your results.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-scope-scopes - 0.1+14.10.20140526-0ubuntu1

---------------
unity-scope-scopes (0.1+14.10.20140526-0ubuntu1) utopic; urgency=low

  [ James Henstridge ]
  * Separate out results sent before and after the "recommendations"
    category, and push them to the SearchReply before and after local
    scope results respectively. (LP: #1312887)
 -- Ubuntu daily release <email address hidden> Mon, 26 May 2014 16:06:08 +0000

Changed in unity-scope-scopes (Ubuntu):
status: Confirmed → Fix Released
Changed in unity-scope-scopes:
status: Triaged → Fix Released
Changed in unity-scope-scopes (Ubuntu):
assignee: nobody → James Henstridge (jamesh)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.