[ 
https://issues.apache.org/jira/browse/SOLR-13213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16760290#comment-16760290
 ] 

Tomás Fernández Löbbe commented on SOLR-13213:
----------------------------------------------

I'm wondering if this is the right move. Components will now lack of all the 
information added by {{prepDistributed}} (which may be a break for existing 
custom components). Also, looking at this code in the 
{{SearchHandler.getAndPrepShardHandler}}:
{code:java}
if (rb.isDistrib) {
      shardHandler = shardHandlerFactory.getShardHandler();
      shardHandler.prepDistributed(rb);
      if (!rb.isDistrib) {
        shardHandler = null; // request is not distributed after all and so the 
shard handler is not needed
      }
    }
{code}
Looks like {{prepDistributed}} can change the value of {{rb.isDistrib}}, and in 
this case the components would have gotten a wrong value. I'm not saying we 
shouldn't do the change, but it does look like a breaking one. Maybe the right 
move in this case is to have a custom SearchHandler that implements the logic 
to decide distrib=true/false, and then call {{super()}}?  Or a custom 
{{ShardHandlerFactory}}?

> Search Components cannot modify "shards" parameter
> --------------------------------------------------
>
>                 Key: SOLR-13213
>                 URL: https://issues.apache.org/jira/browse/SOLR-13213
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: search
>            Reporter: Jan Høydahl
>            Assignee: Jan Høydahl
>            Priority: Major
>             Fix For: 8.x
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When creating a custom search component for a customer, I realised that 
> modifying "shards" parameter in {{prepare()}} is not possible since in 
> {{SearchHandler}}, the {{ShardHandler}} is initialised based on "shards" 
> parameter just *before* search components are consulted.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to