Hi Hoss

I feel so stupid right now, thank you so much!
Of course this makes much more sense. Why should we want to have different 
Timezones for different facets. Hopefully I don't come across as being 
sarcastic, I really think that it makes more sense that it's a global modifier.
After reading the Documentation again it is clear that TZ should not be 
specified on a per facet level.
It is clearly specified in the documentation:
[.]&facet.range.gap=%2B1DAY&TZ=America/Los_Angeles&wt=xml
as opposed to
[.]&facet.range.gap=%2B1DAY&facet.range.TZ=America/Los_Angeles&wt=xml

Now I am good to go, but one very small problem I still have:
I could just send http requests as fallowing:

---

GET https://<server-dns>/solr/<collection>/query?TZ=Europe/Zurich 
Accept: application/json
Content-Type: application/json

{
        "query": "*:*",
        "limit": 0,
        "facet": {
                "series": {
                        "field": "<date-field>",
                        "gap": "+1MONTH",
                        "start": "2024-01-01T00:00:00Z/MONTH",
                        "end": "2024-07-01T00:00:00Z",
                        "type": "range"
                }
        }
}

---

But I am not able to make it work when specifying all in the json body:

---

GET https://<server-dns>/solr/<collection>/query
Accept: application/json
Content-Type: application/json

{
        "query": "*:*",
        "limit": 0,
        "facet": {
                "series": {
                        "field": "<date-field>",
                        "gap": "+1MONTH",
                        "start": "2024-01-01T00:00:00Z/MONTH",
                        "end": "2024-07-01T00:00:00Z",
                        "type": "range"
                }
        },
        "TZ", "Europe/Zurich"
}

---

I get a response with the fallowing json:

---

"error": {
        "metadata": [
                "error-class",
                "org.apache.solr.common.SolrException",
                "root-error-class",
                "org.apache.solr.common.SolrException"
        ],
        "msg": "Unknown top-level key in JSON request : TZ",
        "code": 400
}

---

I again tried it with all possible similar key names: tz, timezone, time-zone & 
time_zone

Don't get me wrong, I am still very grateful for the help that you gave me, 
even if its not possible to specify the TZ in the json body I still know now 
how to use different time zones.

With Kind Regards,

Dario

Reply via email to