Roiocam commented on code in PR #481:
URL: 
https://github.com/apache/incubator-pekko-connectors/pull/481#discussion_r1495141542


##########
solr/src/main/scala/org/apache/pekko/stream/connectors/solr/impl/SolrFlowStage.scala:
##########
@@ -114,8 +113,12 @@ private final class SolrFlowLogic[T, C](
 
       message.routingFieldValue.foreach { routingFieldValue =>
         val routingField = client match {
-          case csc: CloudSolrClient =>
-            Option(csc.getIdField)
+          case csc: CloudSolrClient => {
+            val docCollection = 
Option(csc.getZkStateReader.getCollection(collection))
+            docCollection.flatMap { dc =>
+              Option(dc.getRouter.getRouteField(dc))
+            }

Review Comment:
   ```suggestion
             case csc: CloudSolrClient => {
               val docCollection = 
Some(csc.getZkStateReader.getCollection(collection))
               docCollection.flatMap { dc =>
                 Some(dc.getRouter.getRouteField(dc))
               }
   ```
   
   `Some` and `None` is a group of subclasses of `Option`, in Scala, we 
recommend using `Some` rather than directly use `Option`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to