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

Indicate if "numTotalResults" is an approximated count in VariantQueryResult #749

Closed
2 tasks done
j-coll opened this issue Nov 29, 2017 · 1 comment
Closed
2 tasks done
Assignees
Milestone

Comments

@j-coll
Copy link
Member

j-coll commented Nov 29, 2017

An approximated count was added in #638 as part of the integration with Solr. This will return an approximation count with about 1% of error, we need to inform users if the numTotalResults returned is exact or an approximation.

This approximateCount will be executed if the VariantStorageEngine intersects results from Solr and MongoDB and the param "approximateCount" is true.
It may happen that, even if the param "approxCount" is present, the result is not approximated (the number of samples was bigger than the totalCount, or the query went entirely to Solr. For this situations, it will be interesting to have a boolean field in VariantQueryResult indicating this.

  • Add boolean field to specify if the total count (if any) is approximated or not
  • Add sampling size for the approximate count
@j-coll j-coll self-assigned this Nov 29, 2017
@imedina imedina added this to the v1.3.0 milestone Nov 30, 2017
@imedina
Copy link
Member

imedina commented Nov 30, 2017

With this the Variant query result returned will look like this:

{
id: "",
dbTime: 13,
numResults: 10,
numTotalResults: 5643,
approximateCount: true,
warningMsg: "Data from Solr + mongodb",
errorMsg: "",
resultType: "org.opencb.biodata.models.variant.Variant",
result: [...]
}

where the 5643 of numTotalResults is an aproximation with ~1% error.

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

No branches or pull requests

2 participants