datacube-core icon indicating copy to clipboard operation
datacube-core copied to clipboard

need support product grouping in core

Open pindge opened this issue 2 years ago • 5 comments

ASTERS are not part of DEA products, but due to alphabetical ordering they are always the first products showing up on query dc.list_products()

image

core should add a feature to support pre-identified grouping, ie.

dc.list_products(group='c3')

pindge avatar Nov 23 '22 22:11 pindge

Yep, being able to sort our datasets by the "Baseline satellite data", "Inland water" etc groupings would be really nice!

robbibt avatar Nov 28 '22 02:11 robbibt

one potential solution is to add product_category to product metadata definition, and to query against it

[8:38 AM] Paul Haesler If product_category was listed in the metadata_type as a search field, you could use dc.index.products.search_robust(product_category="foo") - but you'd still need to trawl through the results manually. search_robust is the only method provided for searching products, and it's really intended for internal use by the dataset search methods rather than direct user use.

Even then, it's highly inefficient - there's an implicit assumption that the product table is small enough that it's OK to do a full table scan every query, so honestly, you may as well just do that manually. ​[8:40 AM] Paul Haesler The search_robust code would look something like:

[ prod for prod, unmatchable in dc.index.search_robust(product_category="foo") if not unmatchable]

pindge avatar Nov 29 '22 21:11 pindge

As noted in Teams, a products version of search_by_metadata would be doable.

SpacemanPaul avatar Nov 29 '22 22:11 SpacemanPaul

Oh correction to above:

[ prod for prod, unmatchable in dc.index.products.search_robust(product_category="foo") if not unmatchable]

is equivalent to:

dc.index.products.search(product_category="foo")

But again, this requires product_category to be configured search field.

SpacemanPaul avatar Dec 01 '22 00:12 SpacemanPaul

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 02 '23 03:04 stale[bot]