cambialens / lens-api-doc

10 stars 6 forks source link

Filtering by creation date #25

Closed magd-kudama-dev closed 4 years ago

magd-kudama-dev commented 4 years ago

I wanted to know whether it's possible to filter by created or published_date (in a range)? If yes, how?

Do I have access to all ElasticSearch capabilities (I'm assuming you're using ES given the formatting of the API).

Thank you.

rosharma9 commented 4 years ago

You can use like this: https://docs.api.lens.org/examples.html#get-30-works-from-an-institution-published-between-two-years

"filter": {
    "range": {
        "created": {
            "gte": "2018-05-12",
            "lte": "2020-05-12"
        }
    }
}

Yes, you have access to queries but we haven't enabled aggregations.

magd-kudama-dev commented 4 years ago

Thanks, yea I figured but never closed the issue, sorry.