[
https://issues.apache.org/jira/browse/SOLR-16916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17780118#comment-17780118
]
David Smiley edited comment on SOLR-16916 at 10/26/23 11:05 PM:
----------------------------------------------------------------
defType is the query parser to use for "q" (as we all know). But if the user
uses the JSON Query DSL +with JSON for the value of the query+ (vs a String),
then defType should either be ignored (what I did here) or maybe we consider it
an error. Or let it be as it was but it's kind of a sneaky issue.
For reference, the test here in TestJsonRequestWithEdismaxDefType posts the
following JSON:
{code:json}
{
"query":{
"bool":{"should":[{"lucene":{"query":"id:1"}}, "id:2"]}
}
}
{code}
In the JSON Query DSL, "query" is an alias for "q". Its value is JSON (not a
string) in this example but it may be a string. The internal workings convert
this JSON to a local-params based structure that must be parsed by the lucene
query parser (not edismax or anything else).
was (Author: dsmiley):
defType is the query parser to use for "q" (as we all know). But if the user
uses the JSON Query DSL +with JSON for the value of the query+ (vs a String),
then defType should either be ignored (what I did here) or maybe we consider it
an error. Or let it be as it was but it's kind of a sneaky issue.
> JSON Query DSL doesn't work if defType isn't lucene
> ---------------------------------------------------
>
> Key: SOLR-16916
> URL: https://issues.apache.org/jira/browse/SOLR-16916
> Project: Solr
> Issue Type: Bug
> Components: query parsers
> Affects Versions: 7.2
> Reporter: David Smiley
> Assignee: David Smiley
> Priority: Minor
> Fix For: 9.4
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> If the [JSON Query DSL|https://solr.apache.org/guide/8_4/json-query-dsl.html]
> is used (POSTing JSON), it requires that the default "lucene" query parser is
> used. If for some reason defType is set, like in the defaults section of the
> request handler, then this doesn't work. Internally, the JSON is rewritten
> to local-params syntax which requires the default parser, not another like
> edismax.
> This behavior broke in 7.2 when other parsers stopped processing local-params
> in the name of security.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]