You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jonny Marks (JIRA)" <ji...@apache.org> on 2017/02/01 12:12:51 UTC

[jira] [Updated] (SOLR-9800) FacetComponent - move construction of SimpleFacets to a protected method

     [ 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 BytesRefFilter 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.


> 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
>            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 BytesRefFilter 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org