lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uri Boness (JIRA)" <>
Subject [jira] Commented: (SOLR-1644) Provide a clean way to keep flags and helper objects in ResponseBuilder
Date Sun, 13 Dec 2009 18:13:18 GMT


Uri Boness commented on SOLR-1644:

bq. if ( == Boolean.TRUE)

This is verbose... too verbose to my taste. I believe a Store interface can help here which
provide access to data by a key and will also provide helper methods to keep the code clean.
(a MapStore can be a simple implementation which wraps a Map<String, Object> instance):

public interface Context {

    Boolean getBoolean(String key);
    boolean getBoolean(String key, boolean defaultValue);
    Integer getInt(String key);
    int getInt(String key, int defaultValue);

    //other methods for all primitive types and dates.

so now you have:

if (, false))

which is cleaner and is NPE-safe.

bq. I believe the public API's should have no dependency on components .
I agree. Basically avoid having circular dependencies. You don't want to change the platform
API every time you introduce a new component.

> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>                 Key: SOLR-1644
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.5
>         Attachments: SOLR-1644.patch
> Many components such as StatsComponent, FacetComponent etc keep flags and helper objects
in ResponseBuilder. Having to modify the ResponseBuilder for such things is a very kludgy
> Let us provide a clean way for components to keep arbitrary objects for the duration
of a (distributed) search request.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message