You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org> on 2009/12/11 11:39:18 UTC
[jira] Created: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Provide a clean way to keep flags and helper objects in ResponseBuilder
-----------------------------------------------------------------------
Key: SOLR-1644
URL: https://issues.apache.org/jira/browse/SOLR-1644
Project: Solr
Issue Type: Improvement
Components: search
Reporter: Shalin Shekhar Mangar
Assignee: Shalin Shekhar Mangar
Fix For: 1.5
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 solution.
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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789226#action_12789226 ]
Noble Paul commented on SOLR-1644:
----------------------------------
Let us keep a Map in RB so that each component can store/retrieve any values it want. It can be considered as a session object .
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> Project: Solr
> Issue Type: Improvement
> Components: search
> Reporter: Shalin Shekhar Mangar
> Assignee: Shalin Shekhar Mangar
> Fix For: 1.5
>
>
> 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 solution.
> 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.
[jira] Updated: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Noble Paul updated SOLR-1644:
-----------------------------
Attachment: SOLR-1644.patch
A new Map is kept is ResponseBuilder. It is also possible to use SolrQueryRequest.getContext(). Let us make that call.
Every component keeps a private Object as the key and stores values by that key in rb.store . No other component can access that value because the key is a private Object (So no conflict). The patch illustrates how FacetComponent has eliminated the variables from ResponseBuilder. If it is fine , we can remove the rest of it too such as doStats,needDocList,needDocSet etc
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789917#action_12789917 ]
Yonik Seeley commented on SOLR-1644:
------------------------------------
bq. This one change can keep the ResponseBuilder from being a kitchen sink
But we should do it selectively. Replacing a bunch of flags with public strings that one needs to look up doesn't seem to be an improvement.
if (rb.doHighlighting)
vs
if ((Boolean)rb.store.get(HighlightingComponent.DO_HIGHLIGHTING))
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789269#action_12789269 ]
Noble Paul commented on SOLR-1644:
----------------------------------
bq.
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789290#action_12789290 ]
Uri Boness commented on SOLR-1644:
----------------------------------
bq. We should not keep it static. public final should be good enough
Is there a special reason for this? Is the plan to have a KEY per component instance? If so, how would it be possible to refer to the key from other components?
This is what I had in mind - Assuming Component1 computed something and registered it in the store using KEY. Then Component2 can reuse this computation by accessing it as follows:
{code}
Object someValue = rb.store.get(Component2.KEY);
// do something with someValue
{code}
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Updated: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Noble Paul updated SOLR-1644:
-----------------------------
Comment: was deleted
(was:
bq.)
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789259#action_12789259 ]
Uri Boness commented on SOLR-1644:
----------------------------------
It should also be possible to share objects between components to eliminate duplicate computations (if one component can re-use a computation that was already done in another component). I guess this can be supported by publishing the key as a public static field.
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789986#action_12789986 ]
Noble Paul commented on SOLR-1644:
----------------------------------
bq.But perhaps we should have gone with the same strategy as the UpdateProcessorChain
yes, it is. because there are more than one method call per component per request. Should we still try to do it?
bq.Changing from a method or member to a hash lookup doesn't reduce a dependency when it's needed.
not true. The fact is that ResponseBuilder stops depending on other components . It is ok for components to depend on ResponseBuilder.
bq. I believe a Store interface can help here which provide access to data by a key
Looks better.
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789919#action_12789919 ]
Noble Paul commented on SOLR-1644:
----------------------------------
bq. if ((Boolean)rb.store.get(HighlightingComponent.DO_HIGHLIGHTING))
This may cause NPE
so it will look like
if (rb.store.get(HighlightingComponent.DO_HIGHLIGHTING) == Boolean.TRUE)
definitely it looks verbose (ugly) . But the point is where do we stop? Which all components qualify to be important enough. Is 'my component' more/lessimportant than FacetComponent. If we set a coding standard , isn't that better? I believe the public API's should have no dependency on components .
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789925#action_12789925 ]
Yonik Seeley commented on SOLR-1644:
------------------------------------
bq. definitely it looks verbose (ugly) . But the point is where do we stop?
Where it makes sense. There's no reason for an all or nothing approach. There's no reason not to give some special treatment to some main components.
If one want's to better decompose some of the state for each handler, I guess there could be objects that represented that too?
class ResponseBuilder {
QueryInfo queryInfo;
FacetInfo facetInfo;
}
But perhaps we should have gone with the same strategy as the UpdateProcessorChain... an actual object is created for each component to keep the state for the request.
bq. I believe the public API's should have no dependency on components .
Changing from a method or member to a hash lookup doesn't reduce a dependency when it's needed.
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Updated: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Noble Paul updated SOLR-1644:
-----------------------------
Attachment: SOLR-1644.patch
no changes to any component. The Store field is created. and if any component wishes to use it , it can do so.
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> Project: Solr
> Issue Type: Improvement
> Components: search
> Reporter: Shalin Shekhar Mangar
> Assignee: Shalin Shekhar Mangar
> Fix For: 1.5
>
> Attachments: SOLR-1644.patch, SOLR-1644.patch, 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789236#action_12789236 ]
Uri Boness commented on SOLR-1644:
----------------------------------
Don't you have it already with the SolrQueryRequest.getContext()
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> Project: Solr
> Issue Type: Improvement
> Components: search
> Reporter: Shalin Shekhar Mangar
> Assignee: Shalin Shekhar Mangar
> Fix For: 1.5
>
>
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789920#action_12789920 ]
Uri Boness commented on SOLR-1644:
----------------------------------
bq. if (rb.store.get(HighlightingComponent.DO_HIGHLIGHTING) == 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):
{code}
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.
}
{code}
so now you have:
{code}
if (rb.store.getBoolean(HighlightingComponent.DO_HIGHLIGHTING, false))
{code}
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: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Issue Comment Edited: (SOLR-1644) Provide a clean way to
keep flags and helper objects in ResponseBuilder
Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789920#action_12789920 ]
Uri Boness edited comment on SOLR-1644 at 12/13/09 6:13 PM:
------------------------------------------------------------
bq. if (rb.store.get(HighlightingComponent.DO_HIGHLIGHTING) == 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):
{code}
public interface Store {
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.
}
{code}
so now you have:
{code}
if (rb.store.getBoolean(HighlightingComponent.DO_HIGHLIGHTING, false))
{code}
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.
was (Author: uboness):
bq. if (rb.store.get(HighlightingComponent.DO_HIGHLIGHTING) == 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):
{code}
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.
}
{code}
so now you have:
{code}
if (rb.store.getBoolean(HighlightingComponent.DO_HIGHLIGHTING, false))
{code}
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: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789271#action_12789271 ]
Noble Paul commented on SOLR-1644:
----------------------------------
bq.I guess this can be supported by publishing the key as a public static field.
We should not keep it static. public final should be good enough
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789911#action_12789911 ]
Noble Paul commented on SOLR-1644:
----------------------------------
bq.While we should make it easy for custom components to store their own flags + state, etc, we should be careful about hiding the state of well known components
By keeping the key public we ensure that other components can see/change it.
bq.it eliminates a hash lookup for each component each time through the loop
We do 100s of hash lookups in each request. This one change can keep the ResponseBuilder from being a kitchen sink and the design cleaner .
bq.Is the plan to have a KEY per component instance? If so, how would it be possible to refer to the key from other components?
you are right. We should make it public static. I hope that there aren't multiple instances of the same component registered in the same handler
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Commented: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789745#action_12789745 ]
Yonik Seeley commented on SOLR-1644:
------------------------------------
While we should make it easy for custom components to store their own flags + state, etc, we should be careful about hiding the state of well known components. It's OK to hide internal implementation stuff, but we should leave anything useful to other components exposed (and more explicitly spell out what it means, if it can be changed by another component, etc).
Whether a request is a faceting request or not could certainly be useful to other components... and as a bonus it eliminates a hash lookup for each component each time through the loop.
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> 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 solution.
> 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.
[jira] Updated: (SOLR-1644) Provide a clean way to keep flags and
helper objects in ResponseBuilder
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Noble Paul updated SOLR-1644:
-----------------------------
Attachment: SOLR-1644.patch
implemented as Uri said
> Provide a clean way to keep flags and helper objects in ResponseBuilder
> -----------------------------------------------------------------------
>
> Key: SOLR-1644
> URL: https://issues.apache.org/jira/browse/SOLR-1644
> Project: Solr
> Issue Type: Improvement
> Components: search
> Reporter: Shalin Shekhar Mangar
> Assignee: Shalin Shekhar Mangar
> Fix For: 1.5
>
> Attachments: SOLR-1644.patch, 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 solution.
> 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.