You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/06/01 18:23:42 UTC

[GitHub] [solr] janhoy commented on a diff in pull request #887: SOLR-16227 Use local params value syntax for phrase queries

janhoy commented on code in PR #887:
URL: https://github.com/apache/solr/pull/887#discussion_r887170885


##########
solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrFilter.java:
##########
@@ -362,8 +362,9 @@ protected String translateLike(RexNode like) {
         // but that expects the terms wrapped in double-quotes, not parens
         boolean hasMultipleTerms = terms.split("\\s+").length > 1;
         if (hasMultipleTerms && (terms.contains("*") || terms.contains("?"))) {
-          String quotedTerms = "\"" + terms.substring(1, terms.length() - 1) + "\"";
-          return "{!complexphrase}" + pair.getKey() + ":" + quotedTerms;
+          String quotedTerms = "\\\"" + terms.substring(1, terms.length() - 1) + "\\\"";
+          String query = pair.getKey() + ":" + quotedTerms;
+          return String.format("{!complexphrase v=\"%s\"}", query);

Review Comment:
   ```suggestion
             return String.format(Locale.ROOT, "{!complexphrase v=\"%s\"}", query);
   ```
   This should fix the precommit failure



-- 
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: issues-unsubscribe@solr.apache.org

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


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