NCEAS / metacat

Data repository software that helps researchers preserve, share, and discover data
https://knb.ecoinformatics.org/software/metacat
GNU General Public License v2.0
25 stars 12 forks source link

Index a query string for collections #1378

Closed laurenwalker closed 4 years ago

laurenwalker commented 5 years ago

We need to create a subprocessor for collection and portal documents that gets the filter elements and constructs a Solr query string. That string should be set as a value on a new Solr field. Our various tools will execute the query from that field to find the list of datasets in a collection.

The query will be constructed using the logic already completed in MetacatUI in FIlters.getQuery(): https://github.com/NCEAS/metacatui/blob/feature-project-editor/src/js/collections/Filters.js#L68

The GH with some additional documentation on how the query is constructed is here: https://github.com/NCEAS/metacatui/issues/1046

laurenwalker commented 5 years ago

Just to reiterate from our conversation this morning, the filters will be grouped into three groups, which are OR'ed together:

Filters in group1 are OR'ed together. Filters in group2 and group3 are ANDed together.

Group1 and Group2 are OR'ed together. Group1 and Group2 are grouped together and ANDed with group3.

Example: ((group1) OR (group2)) AND (group3)

((isPartOf:x or id:y or seriesId:z) OR (anyOtherField:zz)) AND (formatType:METADATA AND -obsoletedBy:*)

The reason behind this query structure is that the collection should be made up of the following:

gothub commented 4 years ago

The memberQuery field has been added to the index, in commits:

babfdadfe0503f4aadd0470a7307b71da46b9f36 34a255b01c7516ce12a795afa4794e05142d43c8 b17de92febc2742d6eaa8b23b0d89ee2195073a5