madrob commented on a change in pull request #247:
URL: https://github.com/apache/solr/pull/247#discussion_r682942562
##########
File path: solr/core/src/java/org/apache/solr/handler/sql/SolrFilter.java
##########
@@ -278,6 +265,24 @@ protected String translateComparison(RexNode node) {
}
}
+ private String toEqualsClause(String key, RexLiteral value, RexNode node) {
+ SqlTypeName fieldTypeName = ((RexCall)
node).getOperands().get(0).getType().getSqlTypeName();
+ String terms = toSolrLiteralForEquals(value, fieldTypeName).trim();
+
+ boolean wrappedQuotes = false;
+ if (!terms.startsWith("(") && !terms.startsWith("[") &&
!terms.startsWith("{")) {
+ terms = "\"" + terms + "\"";
+ wrappedQuotes = true;
Review comment:
Out of scope here, but #236 has me thinking about what if there are
quotes inside of the terms.
##########
File path: solr/core/src/java/org/apache/solr/handler/sql/SolrFilter.java
##########
@@ -278,6 +265,24 @@ protected String translateComparison(RexNode node) {
}
}
+ private String toEqualsClause(String key, RexLiteral value, RexNode node) {
+ SqlTypeName fieldTypeName = ((RexCall)
node).getOperands().get(0).getType().getSqlTypeName();
+ String terms = toSolrLiteralForEquals(value, fieldTypeName).trim();
+
+ boolean wrappedQuotes = false;
+ if (!terms.startsWith("(") && !terms.startsWith("[") &&
!terms.startsWith("{")) {
+ terms = "\"" + terms + "\"";
+ wrappedQuotes = true;
Review comment:
I was imagining that it would be more work than it ended up actually
being
--
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]