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

FacetComponent - move construction of SimpleFacets to a protected method

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None
    • Flags:
      Patch

      Description

      This patch moves the construction of SimpleFacets from inside process() to a new protected method, allowing contrib modules to reuse FacetComponent with a different SimpleFacets implementation.

      For example:

      class MyFacetComponent extends FacetComponent {
        @Override
        protected SimpleFacets newSimpleFacets(SolrQueryRequest req, DocSet docSet, SolrParams params, ResponseBuilder rb) {
          return new SimpleFacets(req, docSet, params, rb) {
            @Override
            protected Predicate<BytesRef> newBytesRefFilter(String field, SolrParams params) {
              ...
              return new MyBytesRefFilter (...);
            }    
          };
        }
      }
      

        Issue Links

          Activity

          Hide
          jm100 Jonny Marks added a comment -

          Attaching patch

          Show
          jm100 Jonny Marks added a comment - Attaching patch
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit ef03480743d8d9ff28e34eb6e3af92cb33022ec6 in lucene-solr's branch refs/heads/master from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ef03480 ]

          SOLR-9800: Factor out FacetComponent.newSimpleFacets method. (Jonny Marks via Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit ef03480743d8d9ff28e34eb6e3af92cb33022ec6 in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ef03480 ] SOLR-9800 : Factor out FacetComponent.newSimpleFacets method. (Jonny Marks via Christine Poerschke)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit be87c9b892c016e58ad981fd900e1a5024a70967 in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=be87c9b ]

          SOLR-9800: Factor out FacetComponent.newSimpleFacets method. (Jonny Marks via Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit be87c9b892c016e58ad981fd900e1a5024a70967 in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=be87c9b ] SOLR-9800 : Factor out FacetComponent.newSimpleFacets method. (Jonny Marks via Christine Poerschke)
          Hide
          cpoerschke Christine Poerschke added a comment -

          side note: discovered git --apply --3way here because via just git --apply the patch no longer applied cleanly.

          Show
          cpoerschke Christine Poerschke added a comment - side note: discovered git --apply --3way here because via just git --apply the patch no longer applied cleanly.
          Hide
          cpoerschke Christine Poerschke added a comment -

          Thanks Jonny!

          Show
          cpoerschke Christine Poerschke added a comment - Thanks Jonny!

            People

            • Assignee:
              cpoerschke Christine Poerschke
              Reporter:
              jm100 Jonny Marks
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development