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

David Smiley commented on SOLR-17221:
-------------------------------------

Yeah that's a bug!  PR welcome.

> Http2SolrClient merges case sensitive solr params
> -------------------------------------------------
>
>                 Key: SOLR-17221
>                 URL: https://issues.apache.org/jira/browse/SOLR-17221
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: SolrJ
>    Affects Versions: 9.5.0
>            Reporter: Yue Yu
>            Priority: Major
>
> In solr9.5.0/solrj9.5.0,  the multi-shard requests are sent through 
> Http2SolrClient, and this function composes the actual Jetty Request object:
> {code:java}
> private Request fillContentStream(
>       Request req,
>       Collection<ContentStream> streams,
>       ModifiableSolrParams wparams,
>       boolean isMultipart)
>       throws IOException {
>     if (isMultipart) {
>       // multipart/form-data
>       try (MultiPartRequestContent content = new MultiPartRequestContent()) {
>         Iterator<String> iter = wparams.getParameterNamesIterator();
>         while (iter.hasNext()) {
>           String key = iter.next();
>           String[] vals = wparams.getParams(key);
>           if (vals != null) {
>             for (String val : vals) {
>               content.addFieldPart(key, new StringRequestContent(val), null);
>             }
>           }
>         }
>         if (streams != null) {
>           for (ContentStream contentStream : streams) {
>             String contentType = contentStream.getContentType();
>             if (contentType == null) {
>               contentType = "multipart/form-data"; // default
>             }
>             String name = contentStream.getName();
>             if (name == null) {
>               name = "";
>             }
>             HttpFields.Mutable fields = HttpFields.build(1);
>             fields.add(HttpHeader.CONTENT_TYPE, contentType);
>             content.addFilePart(
>                 name,
>                 contentStream.getName(),
>                 new InputStreamRequestContent(contentStream.getStream()),
>                 fields);
>           }
>         }
>         req.body(content);
>       }
>     } else {
>       // application/x-www-form-urlencoded
>       Fields fields = new Fields();
>       Iterator<String> iter = wparams.getParameterNamesIterator();
>       while (iter.hasNext()) {
>         String key = iter.next();
>         String[] vals = wparams.getParams(key);
>         if (vals != null) {
>           for (String val : vals) {
>             fields.add(key, val);
>           }
>         }
>       }
>       req.body(new FormRequestContent(fields, FALLBACK_CHARSET));
>     }
>     return req;
>   } {code}
> The problem is the use of this class *Fields fields = new Fields();*  where 
> caseSensitive=false by default, this leads to case sensitive solr params 
> being merged together. For example f.case_sensitive_field.facet.limit=5 & 
> f.CASE_SENSITIVE_FIELD.facet.limit=99
> Not sure if this is intentional for some reason?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to