DataONEorg / collections-portals-schemas

Enabling project and data paper views via MetacatUI, Metacat, and EML
Apache License 2.0
3 stars 3 forks source link

Confirm that Solr can actually use exclude on a filterGroup the way we want it to #88

Closed robyngit closed 3 years ago

robyngit commented 3 years ago

In the proposal for the new Collections and Portals schemas, we want to use an exclude field on a filterGroup. The idea is to create a query where we can exclude the portion of results that match a sub-query. We need to test whether we are able to create such queries in Solr before adding this enhancement to the schema.

This relates to issue #70.

robyngit commented 3 years ago

After some testing, I believe that exclude will work they way we'd expect. An example:

Query 1: A collection of three datasets

Query: (keywordsText:"pollinator-mediated selection" AND "deception" AND "Thynnine wasps") AND (-obsoletedBy:* AND formatType:METADATA) Results: 3 PIDs:

Query 2: A larger collection of data containing all the data from Query 1

Query: (originText:Peakall AND abstract:orchids) AND (-obsoletedBy:* AND formatType:METADATA) Results: 30

PIDs: - http://dx.doi.org/10.5061/dryad.bm29v/4?ver=2015-09-16T13:43:04.947-04:00 - https://doi.org/10.5061/dryad.13n29?ver=2018-04-18T05:49:43.314+00:00 - https://doi.org/10.5061/dryad.13n29?ver=2018-04-18T13:45:10.541+00:00 - http://dx.doi.org/10.5061/dryad.13n29?ver=2014-02-17T13:23:58.823-05:00 - http://dx.doi.org/10.5061/dryad.mq5qh/2?ver=2015-04-28T09:44:13.122-04:00 - http://dx.doi.org/10.5061/dryad.mq5qh/1?ver=2015-04-28T09:44:10.163-04:00 - http://dx.doi.org/10.5061/dryad.mq5qh/1?ver=2017-02-06T07:13:19.011-05:00 - https://doi.org/10.5061/dryad.54h75r8?ver=2018-09-14T21:43:31.229+00:00 - https://doi.org/10.5061/dryad.bm29v?ver=2018-04-27T14:11:07.082+00:00 - http://dx.doi.org/10.5061/dryad.bm29v?ver=2016-04-12T18:29:09.727-04:00 - http://dx.doi.org/10.5061/dryad.bm29v?ver=2015-09-16T13:43:01.999-04:00 - https://doi.org/10.5061/dryad.6jq11?ver=2018-05-19T12:34:12.683+00:00 - https://doi.org/10.5061/dryad.6jq11?ver=2018-05-19T14:01:14.919+00:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-06-26T11:59:00.743-04:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-07-17T07:59:03.585-04:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-07-19T12:54:10.684-04:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-09-06T08:47:38.447-04:00 - https://doi.org/10.5061/dryad.mq5qh?ver=2018-04-26T13:52:09.810+00:00 - https://doi.org/10.5061/dryad.mq5qh?ver=2018-04-25T20:03:40.524+00:00 - http://dx.doi.org/10.5061/dryad.mq5qh?ver=2015-04-28T09:44:07.276-04:00 - http://dx.doi.org/10.5061/dryad.mq5qh?ver=2015-10-12T15:03:47.093-04:00 - https://doi.org/10.5061/dryad.92961?ver=2018-04-24T23:42:22.541+00:00 - https://doi.org/10.5061/dryad.92961?ver=2018-04-25T17:56:53.281+00:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-01-22T12:33:23.629-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:47:41.892-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:44:48.402-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:52:54.268-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:50:38.453-05:00 - https://doi.org/10.5061/dryad.2hf40?ver=2018-05-24T16:02:17.680+00:00 - http://dx.doi.org/10.5061/dryad.2hf40?ver=2017-02-08T16:19:34.381-05:00

Note that the PIDs in Query 2 contain all the PIDs from Query 1

Query 3: The same collection as Query 2, but excluding the three data from Query 1

Query: (originText:Peakall AND abstract:orchids) AND -(keywordsText:"pollinator-mediated selection" AND "deception" AND "Thynnine wasps") AND (-obsoletedBy:* AND formatType:METADATA) Results: 27

PIDs: - http://dx.doi.org/10.5061/dryad.bm29v/4?ver=2015-09-16T13:43:04.947-04:00 - https://doi.org/10.5061/dryad.13n29?ver=2018-04-18T05:49:43.314+00:00 - https://doi.org/10.5061/dryad.13n29?ver=2018-04-18T13:45:10.541+00:00 - http://dx.doi.org/10.5061/dryad.13n29?ver=2014-02-17T13:23:58.823-05:00 - http://dx.doi.org/10.5061/dryad.mq5qh/2?ver=2015-04-28T09:44:13.122-04:00 - http://dx.doi.org/10.5061/dryad.mq5qh/1?ver=2015-04-28T09:44:10.163-04:00 - http://dx.doi.org/10.5061/dryad.mq5qh/1?ver=2017-02-06T07:13:19.011-05:00 - https://doi.org/10.5061/dryad.54h75r8?ver=2018-09-14T21:43:31.229+00:00 - https://doi.org/10.5061/dryad.6jq11?ver=2018-05-19T12:34:12.683+00:00 - https://doi.org/10.5061/dryad.6jq11?ver=2018-05-19T14:01:14.919+00:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-06-26T11:59:00.743-04:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-07-17T07:59:03.585-04:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-07-19T12:54:10.684-04:00 - http://dx.doi.org/10.5061/dryad.6jq11?ver=2017-09-06T08:47:38.447-04:00 - https://doi.org/10.5061/dryad.mq5qh?ver=2018-04-26T13:52:09.810+00:00 - https://doi.org/10.5061/dryad.mq5qh?ver=2018-04-25T20:03:40.524+00:00 - http://dx.doi.org/10.5061/dryad.mq5qh?ver=2015-04-28T09:44:07.276-04:00 - http://dx.doi.org/10.5061/dryad.mq5qh?ver=2015-10-12T15:03:47.093-04:00 - https://doi.org/10.5061/dryad.92961?ver=2018-04-24T23:42:22.541+00:00 - https://doi.org/10.5061/dryad.92961?ver=2018-04-25T17:56:53.281+00:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-01-22T12:33:23.629-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:47:41.892-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:44:48.402-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:52:54.268-05:00 - http://dx.doi.org/10.5061/dryad.92961?ver=2015-02-06T14:50:38.453-05:00 - https://doi.org/10.5061/dryad.2hf40?ver=2018-05-24T16:02:17.680+00:00 - http://dx.doi.org/10.5061/dryad.2hf40?ver=2017-02-08T16:19:34.381-05:00

As expected, the PIDs from Query 1 are excluded from the results.