Solr
  1. Solr
  2. SOLR-4717

SimpleFacets should respect localParams

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      In trying to implement http://wiki.apache.org/solr/HierarchicalFaceting I found the need to send multiple prefix facets in the same request on the same field.

      Currently facet params will parse the localParams, but only use them to pick out a name. We can easily modify things to let localParams override global ones. For example:

      &{!key=level3 facet.prefix=3/path/to/folder}path
      &{!key=level2 facet.prefix=2/path/to}path
      &{!key=level1 facet.prefix=1/path}path
      

      This can easily be supported if we use:

      params = SolrParams.wrapDefaults(localParams, orig);
      

      when local params exist

      ------

      We have come a long way from simple facets!

        Issue Links

          Activity

          Hide
          Ryan McKinley added a comment -

          The meat of the patch is really just:

          +    if (localParams == null) {
          +      return;
          +    }
          +    params = SolrParams.wrapDefaults(localParams, orig);
          
          Show
          Ryan McKinley added a comment - The meat of the patch is really just: + if (localParams == null ) { + return ; + } + params = SolrParams.wrapDefaults(localParams, orig);
          Hide
          Koji Sekiguchi added a comment -

          +1

          Show
          Koji Sekiguchi added a comment - +1
          Hide
          Hoss Man added a comment -

          From a standpoint of usecases to consider and test coverage, there is some good discussion in these other issues to consider...

          SOLR-1351
          SOLR-2251
          SOLR-1387

          Show
          Hoss Man added a comment - From a standpoint of usecases to consider and test coverage, there is some good discussion in these other issues to consider... SOLR-1351 SOLR-2251 SOLR-1387
          Hide
          Ryan McKinley added a comment -

          Hoss, thanks for pointing me to SOLR-1351. I just ported the tests to work with localParams.

          SOLR-1387 seems like a different beast

          Show
          Ryan McKinley added a comment - Hoss, thanks for pointing me to SOLR-1351 . I just ported the tests to work with localParams. SOLR-1387 seems like a different beast
          Hide
          Ryan McKinley added a comment -

          added to 4x and trunk

          Show
          Ryan McKinley added a comment - added to 4x and trunk
          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.
          Hide
          David Smiley added a comment -

          I recalled this was possible but guessed incorrectly it was as simple as using the key name for the other parameters, such as: &facet.field={!key=level1}path&f.level1.facet.prefix=whatever but alas.

          Show
          David Smiley added a comment - I recalled this was possible but guessed incorrectly it was as simple as using the key name for the other parameters, such as: &facet.field={!key=level1}path&f.level1.facet.prefix=whatever but alas.

            People

            • Assignee:
              Ryan McKinley
              Reporter:
              Ryan McKinley
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development