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

Empty buckets when faceting with JSON API on EnumField or TrieIntField

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 5.1, 5.2
    • None
    • faceting
    • None
    • OS X 10.10.3
      $ java -version
      java version "1.8.0_31"
      Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

    Description

      When using the JSON API, faceting on an EnumField or TrieIntField returns an empty list of buckets.

      Steps to reproduce:
      1. Define an EnumField.
      schema.xml:
      <field name="kingdom" type="kingdomEnum" indexed="true" stored="true" required="true" />
      <fieldType name="kingdomEnum" class="solr.EnumField" enumsConfig="enumsConfig.xml" enumName="kingdom"/>

      enumsConfig.xml:
      <?xml version="1.0" ?>
      <enumsConfig>
      <enum name="kingdom">
      <value>plants</value>
      <value>metazoa</value>
      <value>fungi</value>
      </enum>
      </enumsConfig>

      2. Add documents to core.

      3. Faceting over the EnumField returns an empty list of buckets:
      $ curl http://localhost:8983/solr/myCore/query -d '
      {
      query: ":",
      facet : {
      kingdom :

      {terms : kingdom}

      }
      }'
      { ...
      "facets":{
      "count":17,
      "kingdom":

      { "buckets":[]}

      }}

      The same issue happens with TrieIntField. Using old-style facets works, this only happens with the new JSON API.

      I tested changing the field to a string and I get the expected results.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              amunoz Alfonso Muñoz-Pomer Fuentes
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: