[
https://issues.apache.org/jira/browse/SOLR-10894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17749224#comment-17749224
]
Michael Gibney commented on SOLR-10894:
---------------------------------------
I think this is addressed by https://github.com/apache/solr/pull/1781 --
feedback welcome!
Notably, the proposed solution does _not_ modify other special characters
(aside from {{"}} double-quote). This should be ok because we're really
escaping according to the "streaming expression" syntax, which is a kind of
wrapper around the standard query-parsing syntax.
In the streaming-expression context, {{q=[some_query]}}, [some_query] may be
quoted at the streaming-expression-syntax level, to clarify the boundaries of
the `q` param, or unquoted (if quotes are not necessary to clarify the
boundaries of the query). In either case, the q param query (exclusive of
streaming-expression-param boundary quotes) may itself contain quotes. It is
these quotes -- the quotes contained in the q param query _per se_ -- that must
be escaped; and a distinction must be made between such double-quote chars at
the top-level vs. already-escaped inner double-quote chars.
> Streaming expressions handling of escaped special characters bug
> ----------------------------------------------------------------
>
> Key: SOLR-10894
> URL: https://issues.apache.org/jira/browse/SOLR-10894
> Project: Solr
> Issue Type: Bug
> Components: streaming expressions
> Reporter: Houston Putman
> Priority: Major
> Attachments: SOLR-10894.patch
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Streaming expressions expect all special characters in named parameter values
> to be singly escaped. Since queries can contain strings surrounded by double
> quotes, double-escaping is necessary.
> Given the following query:
> {{summary:"\"This is a summary\"\+"}}
> A streaming expression would require surrounding the query with double
> quotes, therefore every special character in the query should be escaped:
> {{select(collection,q="\"\\\"This is a summary\\\"\\\+\"",....)}}
> Streaming expressions should unescape the strings contained within double
> quotes, however currently they are only unescaping {{\" -> "}}. Therefore it
> is impossible to query for text fields containing double quotes. Also other
> special characters are not unescaped; this inconsistency causes confusion.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]