lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonny Marks (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SOLR-9800) FacetComponent - move construction of SimpleFacets to a protected method
Date Mon, 06 Feb 2017 13:56:41 GMT

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


Mime
View raw message