[ 
https://issues.apache.org/jira/browse/SOLR-9800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonny Marks updated SOLR-9800:
------------------------------
    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:

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

  was:
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:

{code}
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 BytesRefFilter newBytesRefFilter(String field, SolrParams 
params) {
        ...
        return new MyBytesRefFilter (...);
      }    
    };
  }
}
{code}


> FacetComponent - move construction of SimpleFacets to a protected method
> ------------------------------------------------------------------------
>
>                 Key: SOLR-9800
>                 URL: https://issues.apache.org/jira/browse/SOLR-9800
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Jonny Marks
>            Assignee: Christine Poerschke
>            Priority: Minor
>         Attachments: SOLR-9800.patch
>
>
> 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:
> {code}
> 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 (...);
>       }    
>     };
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to