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

JSON FacetAPI with enumField throws "Expected numeric field type"

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.4
    • Fix Version/s: None
    • Component/s: Facet Module, faceting
    • Labels:
      None

      Description

      Hi,

      I've posted this issue about 3 weeks ago on the solr-user mailing list here:

      http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201601.mbox/%3C568EEF90.8050100%40gmail.com%3E

      Basically, when using the json facet api on an enum field, like this:

          json.facet={
            states: {field: state}, dates: {field: insertdate}
          }
      

      where state is an enum, i get an error:

        "error":{
          "msg":"Expected numeric field type
      :state{type=auState,properties=indexed,stored,docValues}",
          "code":400}
      

      The full example can be found here: https://gist.github.com/xou/33fd7aab7afe3cebb28b

      And a quick-and-dirty patch can be found here: http://bildungsresistenz.de/tmp.h/0001-Added-support-for-facetting-on-enum-types.patch

      I'm not sure whether the patch is the right way to approach this; if it goes in the right direction i can definitely try to clean it up a bit more.

      Cheers,

      Niko

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nikoweh Nikolai Weh
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: