Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16306

Faceting over a DateRangeField gives empty result

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 8.11.1
    • None
    • faceting

    Description

      Solr gives an empty list of facet values when faceting over a DateRangeField. I would expect Solr to return each unique combination of each range's from and to date as a facet value.

      Here is an example response. Each document has a date range field "validrange_dr" ("*_dr" is mapped to a single-value DateRangeField), but faceting over this attribute gives an empty list of facet values. Doing this for normal date fields works as expected.

      {
        "responseHeader":{
          "status":0,
          "QTime":0,
          "params":{
            "q":"*:*",
            "facet.field":"validrange_dr",
            "indent":"true",
            "fl":"validrange_dr",
            "q.op":"OR",
            "rows":"10",
            "facet":"true",
            "_":"1658503177774"}},
        "response":{"numFound":38,"start":0,"numFoundExact":true,"docs":[
            {
              "validrange_dr":"[2021-06-22T12:18:23.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-06-30T09:49:13.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-07-06T10:48:10.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-07-17T15:36:41.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-08-04T08:23:13.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-06-15T01:05:50.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-07-05T13:33:17.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-05-26T19:33:26.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-06-12T21:29:45.000Z TO 2999-12-31T23:59:59.999Z]"},
            {
              "validrange_dr":"[2021-07-20T20:11:28.000Z TO 2999-12-31T23:59:59.999Z]"}]
        },
        "facet_counts":{
          "facet_queries":{},
          "facet_fields":{
            "validrange_dr":[]},
          "facet_ranges":{},
          "facet_intervals":{},
          "facet_heatmaps":{}}} 

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            thomas@schuerger.com Thomas Schürger

            Dates

              Created:
              Updated:

              Slack

                Issue deployment