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 (...);
            }    
          };
        }
      }
      

        Attachments

          Issue Links

            Activity

              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: