microbiomedata / nmdc-server

Data portal client and server for NMDC.
https://data.microbiomedata.org
Other
9 stars 0 forks source link

Data portal - Depth filter not working as expected when depth is specified as a range in mongo. #1080

Open aclum opened 11 months ago

aclum commented 11 months ago

I had the NEON benthic samples selected in data portal dev (study id nmdc:sty-11-pzmd0x14) and noticed that the depth 'in between' filter is not working properly. For all of these samples in mongo the values for depth.has_maximum_numeric_value=1 and depth.has_minimum_numeric_value=0. I was expecting depth filter of 'in between' 0.1 - 0.5 to return all samples but it returns none. When i run a similar search in data portal prod using biosamples that are part_of nmdc:sty-11-28tm5d36 which also has depth as a range I encounter the same behavior.

I would expect the screenshot below to return 560 samples since all benthic samples (study id nmdc:sty-11-pzmd0x14) were sampled between 0-1 meters.

env: dev and prod data portal

Screenshot 2023-11-06 at 2 59 25 PM

aclum commented 1 week ago

@pkalita-lbl took a quick look at the ingest code and it doesn't appear that the ingest codes knows that depth can be a range in the data in mongo. Unclear if that issue needs to be a separate ticket from this.

naglepuff commented 1 week ago

Nope, that's the same issue. I believe the ingest code brings in the minimum depth. It's unclear without digging in what it would take to support overlapping range queries in general. A more specific fix could be added to address depth in particular.

aclum commented 1 week ago

Based on infra meeting for now if faceted search uses 'in between' unless the range in the records is full contained by the search values results shouldn't be returned. sample A has range of .5-1m and search is 'in between' 0-.75m -> do not show sample A.

ssarrafan commented 3 days ago

@marySalvi @aclum is this active? Will it be worked on next sprint?