[
https://issues.apache.org/jira/browse/SOLR-13764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16942277#comment-16942277
]
Mikhail Khludnev edited comment on SOLR-13764 at 10/1/19 8:09 PM:
------------------------------------------------------------------
[~dsmiley], JSON Query DSL doesn't look like a suitable thing for intervals.
Intervals seems naturally JSON-like - they build as nested scopes, so I want to
[express them in
JSON|https://cwiki.apache.org/confluence/display/SOLR/SOLR-13764+Discussion+-+Interval+Queries+in+JSON].
Query DSL is designed to be a backward compatible with old local-param
QParsers, here are issues:
# we need to repeat parser name at the every level of nesting, but interval
query node might nest only interval query node,
# also interval query node might nest two or more sub nodes, but Query DSL
provide only one sub node - "query"
My proposal is to introduce old style QParser \{!interval}, which will refer
to json.params by name. It allows to combine it with other queries by \{!bool}
and has suitable JSON for intervals. Thus, we get with JSON body request:
{code:java}
{"query":{"interval":{
"df":"description",
"json_param":"int_qry_1"}},
"params":{
"int_qry_1":{
"ordered":["lorem",{"prefix":"ipsum"}],
"max_gaps":3}}
}{code}
was (Author: mkhludnev):
[~dsmiley], JSON Query DSL doesn't look like a suitable thing for intervals.
Intervals seems naturally JSON-like - they build as nested scopes, so I want to
[express them in
JSON|https://cwiki.apache.org/confluence/display/SOLR/SOLR-13764+Discussion+-+Interval+Queries+in+JSON].
Query DSL is designed to be a backward compatible with old local-param
QParsers, here are issues:
# we need to repeat parser name at the every level of nesting, but interval
query node might nest only interval query node,
# also interval query node might nest two or more sub nodes, but Query DSL
provide only one sub node - "query"
My proposal is to introduce old style QParser \{!interval}, which will refer
to json.params by name. It allows to combine it with other queries by \{!bool}
and has suitable JSON for intervals. Thus, we get with JSON body request:
{{{ "query" : }}
{{ {"interval": {}}
{{ "df":"description", }}
{{ "json_param":"int_qry_1"}}}}{{ }}
{{ "params":{}}{{ }}
{{ "int_qry_1" : \{ "ordered": ["lorem", {"prefix":"ipsum"}],}}
{{ "max_gaps":3 }}}{{ }}
{{ }}}
{{} }}
> Parse Interval Query from JSON API
> ----------------------------------
>
> Key: SOLR-13764
> URL: https://issues.apache.org/jira/browse/SOLR-13764
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: query parsers
> Reporter: Mikhail Khludnev
> Priority: Blocker
> Fix For: 8.3
>
>
> h2. Context
> Lucene has Intervals query LUCENE-8196. Note: these are a kind of healthy
> man's Spans/Phrases. Note: It's not about ranges nor facets.
> h2. Problem
> There's no way to search by IntervalQuery via JSON Query DSL.
> h2. Suggestion
> * Create classic QParser \{{ {!interval df=text_content}a_json_param}}, ie
> one can combine a few such refs in {{json.query.bool}}
> * It accepts just a name of JSON params, nothing like this happens yet.
> * This param carries plain json which is accessible via {{req.getJSON()}}
> please examine
> https://cwiki.apache.org/confluence/display/SOLR/SOLR-13764+Discussion+-+Interval+Queries+in+JSON
> for syntax proposal.
> h2. Challenges
> * I have no idea about particular JSON DSL for these queries, Lucene API
> seems like easy JSON-able. Proposals are welcome.
> * Another awkward things is combining analysis and low level query API. eg
> what if one request term for one word and analysis yield two tokens, and vice
> versa requesting phrase might end up with single token stream.
> * Putting json into Jira ticket description
> h2. Q: Why don't..
> .. put intervals DSL right into {{json.query}}, avoiding these odd param
> refs?
> A: It requires heavy lifting for {{JsonQueryConverter}} which is streamlined
> for handling old good http parametrized queires.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]