outbreak-info / outbreak.info-resources

A curated repository of metadata of resources on COVID-19 and SARS-CoV-2
MIT License
0 stars 4 forks source link

Add Nested properties to ES mapping of outbreak.info/resources #79

Open flaneuse opened 4 years ago

flaneuse commented 4 years ago

Due to how ES stores objects, a query of q=firstName:Marco AND lastName:Zhou on

author:[
{firstName: Jerry, lastName: Zhou},
{firstName: Marco, lastName: Cano}
]

would inappropriately return the record containing that author, even though there’s no author “Marco Zhou.”

Enable nested data storage and query syntax as well as facetting on nested objects. Will require parsing of query string to interpret into ES query object, etc. For an example, see implementation in CViSB of ELISA nested queries.

flaneuse commented 4 years ago

Running list of places where objects should be nested:

litcovid: author (note: affiliation can be an object) litcovid: funding (note: funder can be an object) litcovid: isBasedOn litcovid: relatedTo

clinicaltrials: armGroup clinicaltrials: armGroup.intervention clinicaltrials: author clinicaltrials: eligibilityCriteria clinicaltrials: interventions clinicaltrials: isBasedOn clinicaltrials: outcome clinicaltrials: relatedTo clinicaltrials: sponsor clinicaltrials: studyDesign clinicaltrials: studyEvent clinicaltrials: studyLocation clinicaltrials: studyStatus

namespacestd0 commented 3 years ago

You can customize the query behavior by overriding this method: https://github.com/biothings/biothings.api/blob/f4cd5880033de12e57fe6fa09ac5388802888508/biothings/web/query/builder.py#L291