madrob commented on code in PR #905:
URL: https://github.com/apache/solr/pull/905#discussion_r897379088


##########
solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrFilter.java:
##########
@@ -356,13 +367,16 @@ protected String translateLike(RexNode like) {
       terms = translateLikeTermToSolrSyntax(terms, escapeChar);
 
       if (!terms.startsWith("(") && !terms.startsWith("[") && 
!terms.startsWith("{")) {
-        terms = escapeWithWildcard(terms);
+        String solrFieldType = solrFieldTypes.get(pair.getKey()).getType();
+        terms = escapeWithWildcard(terms, solrFieldType);
 
         // if terms contains multiple words and one or more wildcard chars, 
then we need to employ
         // the complexphrase parser
         // but that expects the terms wrapped in double-quotes, not parens
         boolean hasMultipleTerms = terms.split("\\s+").length > 1;
-        if (hasMultipleTerms && (terms.contains("*") || terms.contains("?"))) {
+        if (solrFieldType.equals("text")
+            && hasMultipleTerms

Review Comment:
   Let's think about the order we want these checks, I think there primitive 
Boolean probably should be first. And then reverse the check to be 
"text".equals to be better about null handling. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to