clowder-framework / clowder

A data management system that allows users to share, annotate, organize and analyze large collections of datasets. It provides support for extensible metadata annotation using JSON-LD and a distribute analytics event bus for automatic curation of uploaded data.
https://clowderframework.org/
University of Illinois/NCSA Open Source License
33 stars 17 forks source link

User metadata with nested JSON not properly indexed #403

Open max-zilla opened 1 year ago

max-zilla commented 1 year ago

https://github.com/clowder-framework/clowder/blob/develop/app/util/SearchUtils.scala#L69

This attempts to flatten JSON contents into an array when duplicate keys are encountered. but doesn't work if the JSON is nested. The logic seems to assume the JSON will only be Metadata Definitions (i.e. from GUI). the cat:extractor user doesn't do any of this. Needs to either wait until it reaches leaf node of metadata to do the array-ification, or find another way to index multiple occurrences of a Metadata Definition.