Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check count assets method #12

Open
pral2a opened this issue Jul 26, 2017 · 3 comments
Open

Check count assets method #12

pral2a opened this issue Jul 26, 2017 · 3 comments
Labels

Comments

@pral2a
Copy link
Member

pral2a commented Jul 26, 2017

Issue by pral2a
Monday Jul 10, 2017 at 10:16 GMT
Originally opened as https://github.com/OrganicityEu/organicity-discovery-api/issues/31


Count assets might have some issues and doesn't return the right number of assets

GET https://discovery.organicity.eu/v0/assets/geo/zoom/1?lat=43.45487000&long=-3.81289000

Model:

https://github.com/OrganicityEu/organicity-discovery-api/blob/16080f81d1913383a8f4cca0c2dcc0b6bbc92792/lib/mongo_orion_client.rb#L113

@pral2a pral2a added this to the OC 2 Open Call milestone Jul 26, 2017
@pral2a pral2a added the bug label Jul 26, 2017
@viktorsmari
Copy link
Contributor

viktorsmari commented Oct 25, 2017

This is the function:
orion[:entities].find(q,m).count

The q is a long list of
{:$and=>[{"_id.id"=>{"$in"=>[/urn:oc:entity:experimenters:3c4*...

And the cities at the end of the query:

... "urn:oc:entity:santander", "urn:oc:entity:london", "urn:oc:entity:aarhus", "urn:oc:entity:patras", "urn:oc:entity:patra"

The m is:
{:skip=>0, :limit=>30, :sort=>"attrs.TimeInstant.value"}

How many assets should we expect?

@pral2a
Copy link
Member Author

pral2a commented Oct 25, 2017

Here quick refactoring that should help us simplify the problem but I haven't yet tested the code

de0648e

@viktorsmari Tomorrow we'll look at it

@viktorsmari
Copy link
Contributor

viktorsmari commented Oct 26, 2017

I tried those changes and the results are:
On zoom level, the count went from:
0, 3929 -> 910
1, 6441 -> 3928
2, 7844 -> 3929
3, 8110 -> 3929
4, 8110 -> 3929
5, 8131 -> 3929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants