CenterForOpenScience / SHARE

SHARE is building a free, open, data set about research and scholarly activities across their life cycle.
http://share-research.readthedocs.io/en/latest/index.html
Apache License 2.0
100 stars 58 forks source link

[ENG-4657] add suggestedFilterOperator #809

Closed aaxelb closed 12 months ago

aaxelb commented 12 months ago

each related-property-path included with an index-card-search response now comes with a suggestedFilterOperator attribute that could be used in another index-card-search request with the query param cardSearchFilter[<propertyPathKey>][<suggestedFilterOperator>]

e.g. the following suggests that adding cardSearchFilter[supplements][is-present] to the current search would yield 1 result

    {
      "id": "...",
      "type": "related-property-path",
      "attributes": {
        "propertyPathKey": "supplements"
        "suggestedFilterOperator": "is-present",
        "cardSearchResultCount": 1,
        // ...
      }
    },

suggests "at-date" for date properties, "is-present" for "boolean filter facets", and "any-of" to recommend an index-value-search to find valid iri values to filter by

(ticket: ENG-4657)