Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/455#discussion_r228032204
  
    --- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java 
---
    @@ -262,6 +263,11 @@ private void flattenAnonymous(List<SolrInputDocument> 
unwrappedDocs, SolrInputDo
         flattenAnonymous(unwrappedDocs, currentDoc, false);
       }
     
    +  public String getRouteFieldVal() {
    --- End diff --
    
    After reading through the code it seems like _route_ is currently only used 
in delete commands and queries.
    This can be seen in DistributedUpdateProceesor#doDeleteByQuery
    `ModifiableSolrParams outParams = new 
ModifiableSolrParams(filterParams(req.getParams()));
          outParams.set(DISTRIB_UPDATE_PARAM, DistribPhase.TOLEADER.toString());
          outParams.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
              zkController.getBaseUrl(), req.getCore().getName()));
    
          SolrParams params = req.getParams();
          String route = params.get(ShardParams._ROUTE_);
          Collection<Slice> slices = coll.getRouter().getSearchSlices(route, 
params, coll);
    
          List<Node> leaders =  new ArrayList<>(slices.size());
          for (Slice slice : slices) {
            String sliceName = slice.getName();
            Replica leader;
            try {
              leader = 
zkController.getZkStateReader().getLeaderRetry(collection, sliceName);
            } catch (InterruptedException e) {
              throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Exception 
finding leader for shard " + sliceName, e);
            }`
    Perhaps this should be moved to addUpdateCommand(perhaps even UpdateCommand)
    or to a method that will be accessible and visible so we do not have this 
confusion in the future?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to