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

use facet "key" as override for field name when looking for per field facet options

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: search
    • Labels:
      None

      Description

      The "key" parameter that is used for aliasing output is very helpful in simplifying the readability of complex facets. However it doesn't seem that this same alias can be used when configuring facets of individual fields. The following example that does not use the key parameter works fine under 1.4.1:

      rows=0&q=:+NOT+customers.blocked:1&facet=true&f.customers_name.facet.mincount=2&facet.field=customers_name

      <lst name="customers_name">
      <int name="jone">2</int>
      </lst>

      The example below also works and does use the key parameter, however note that we're still using the original field name when referring to f.customers_name.facet.mincount:

      rows=0&q=:+NOT+customers.blocked:1&facet=true&f.customers_name.facet.mincount=2&facet.field=

      {!key=alt_name}customers_name

      <lst name="customers_name">
      <int name="jone">2</int>
      </lst>

      The final example below does not work. It uses the alias established by the key parameter to configure the mincount setting for the customers_name field.

      rows=0&q=:+NOT+customers.blocked:1&facet=true&f.alt_name.facet.mincount=2&facet.field={!key=alt_name}

      customers_name

      <lst name="alt_name">
      <int name="jone">2</int>
      <int name="tim">1</int>
      <int name="sami">0</int>
      </lst>

      This is a trivial example. The behavior becomes much more important when talking about facet queries.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tjones Tim Jones
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: