You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Mikhail Khludnev <mk...@apache.org> on 2019/09/06 21:03:14 UTC

(Oh my) Spans in Solr json request

Hello,

Finally we let users to send span queries via XML (yeah) query parser. But
I feel awkward to invoke XML under Json. Straightforward approach lead us
to bunch of span[Or|And|Not|Etc] QParser plugins. Are there any more
elegant ideas?

-- 
Sincerely yours
Mikhail Khludnev

Re: Intervals in Solr json request

Posted by Mikhail Khludnev <mk...@apache.org>.
Jason,
Here we go https://issues.apache.org/jira/browse/SOLR-13764


On Mon, Sep 16, 2019 at 3:05 PM Jason Gerlowski <ge...@gmail.com>
wrote:

> Hi Mikhail,
>
> I'm having trouble understanding the exact syntax you're proposing.
> Is there a jira where the syntax is described in a little more detail?
>  If not, would you care to put together a writeup on a jira somewhere?
>  It's hard (for me at least) to weigh in as things are currently.
>
> Best,
>
> Jason
>
> On Sun, Sep 8, 2019 at 3:25 PM Mikhail Khludnev <mk...@apache.org> wrote:
> >
> > Ok. It might be a parser referring to a json object under some new
> property
> >
> > {
> >    "query": {
> >            "jinterval":"just a name"  // introducing new QPPlugin
> >       },
> >    "jparams": {                       // introducing new top-level entry
> >         "just a name": {
> >               "or":[    "foo",
> >                           "bar",
> >                            { "unordered":
> >                                     ["bag",
> >                                       "baz",
> >                                       "ban",
> >                                        { "phrase": ["moo","foo"]}
> >                                      ]
> >                             }
> >                       ],
> >                "field":"text_content"
> >              }
> >      }
> > }
> >
> > Can we consider it as a spec for the new feature?
> >
> > On Sun, Sep 8, 2019 at 12:16 AM Mikhail Khludnev <mk...@apache.org>
> wrote:
> >>
> >> Thanks for your warm responses. I encounter Intervals, and considering
> introducing them in Solr JSON Request API.
> >> Following Query DSL approach gives me something like
> >> "interval":{  "or":["foo",
> >>                           "bar",
> >>                            {"interval": { "unordered":
> >>                                     ["bag",
> >>                                       "baz",
> >>                                       "ban",
> >>                                        { "interval":{ "phrase":
> ["moo","foo"]} }
> >>                                      ]}
> >>                           }
> >>                         ],
> >>                    "field":"text_content"}
> >> So, it implies creating {!inteval} query parser, which handles local
> param in a certain way, eg  it shouldn't support "or" and "phrase" an the
> same node.
> >> Not sure how to propagate "filed" to term nodes.
> >>
> >> I'd rather want to have more control over syntax and JsonQueryConverter.
> >>  "interval":{  "or":["foo",
> >>                           "bar",
> >>                            { "unordered":
> >>                                     ["bag",
> >>                                       "baz",
> >>                                       "ban",
> >>                                        { "phrase": ["moo","foo"]}
> >>                                      ]}
> >>                               }
> >>                           ],
> >>                    "field":"text_content"}
> >>
> >> Any ideas, preferences?
> >>
> >> On Sat, Sep 7, 2019 at 12:03 AM Mikhail Khludnev <mk...@apache.org>
> wrote:
> >>>
> >>> Hello,
> >>>
> >>> Finally we let users to send span queries via XML (yeah) query parser.
> But I feel awkward to invoke XML under Json. Straightforward approach lead
> us to bunch of span[Or|And|Not|Etc] QParser plugins. Are there any more
> elegant ideas?
> >>>
> >>> --
> >>> Sincerely yours
> >>> Mikhail Khludnev
> >>
> >>
> >>
> >> --
> >> Sincerely yours
> >> Mikhail Khludnev
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

-- 
Sincerely yours
Mikhail Khludnev

Re: Intervals in Solr json request

Posted by Mikhail Khludnev <mk...@apache.org>.
Hello, dev.

What do you think about the syntax proposal?
https://cwiki.apache.org/confluence/display/SOLR/SOLR-13764+Discussion+-+Interval+Queries+in+JSON


On Mon, Sep 16, 2019 at 3:05 PM Jason Gerlowski <ge...@gmail.com>
wrote:

> Hi Mikhail,
>
> I'm having trouble understanding the exact syntax you're proposing.
> Is there a jira where the syntax is described in a little more detail?
>  If not, would you care to put together a writeup on a jira somewhere?
>  It's hard (for me at least) to weigh in as things are currently.
>
> Best,
>
> Jason
>
> On Sun, Sep 8, 2019 at 3:25 PM Mikhail Khludnev <mk...@apache.org> wrote:
> >
> > Ok. It might be a parser referring to a json object under some new
> property
> >
> > {
> >    "query": {
> >            "jinterval":"just a name"  // introducing new QPPlugin
> >       },
> >    "jparams": {                       // introducing new top-level entry
> >         "just a name": {
> >               "or":[    "foo",
> >                           "bar",
> >                            { "unordered":
> >                                     ["bag",
> >                                       "baz",
> >                                       "ban",
> >                                        { "phrase": ["moo","foo"]}
> >                                      ]
> >                             }
> >                       ],
> >                "field":"text_content"
> >              }
> >      }
> > }
> >
> > Can we consider it as a spec for the new feature?
> >
> > On Sun, Sep 8, 2019 at 12:16 AM Mikhail Khludnev <mk...@apache.org>
> wrote:
> >>
> >> Thanks for your warm responses. I encounter Intervals, and considering
> introducing them in Solr JSON Request API.
> >> Following Query DSL approach gives me something like
> >> "interval":{  "or":["foo",
> >>                           "bar",
> >>                            {"interval": { "unordered":
> >>                                     ["bag",
> >>                                       "baz",
> >>                                       "ban",
> >>                                        { "interval":{ "phrase":
> ["moo","foo"]} }
> >>                                      ]}
> >>                           }
> >>                         ],
> >>                    "field":"text_content"}
> >> So, it implies creating {!inteval} query parser, which handles local
> param in a certain way, eg  it shouldn't support "or" and "phrase" an the
> same node.
> >> Not sure how to propagate "filed" to term nodes.
> >>
> >> I'd rather want to have more control over syntax and JsonQueryConverter.
> >>  "interval":{  "or":["foo",
> >>                           "bar",
> >>                            { "unordered":
> >>                                     ["bag",
> >>                                       "baz",
> >>                                       "ban",
> >>                                        { "phrase": ["moo","foo"]}
> >>                                      ]}
> >>                               }
> >>                           ],
> >>                    "field":"text_content"}
> >>
> >> Any ideas, preferences?
> >>
> >> On Sat, Sep 7, 2019 at 12:03 AM Mikhail Khludnev <mk...@apache.org>
> wrote:
> >>>
> >>> Hello,
> >>>
> >>> Finally we let users to send span queries via XML (yeah) query parser.
> But I feel awkward to invoke XML under Json. Straightforward approach lead
> us to bunch of span[Or|And|Not|Etc] QParser plugins. Are there any more
> elegant ideas?
> >>>
> >>> --
> >>> Sincerely yours
> >>> Mikhail Khludnev
> >>
> >>
> >>
> >> --
> >> Sincerely yours
> >> Mikhail Khludnev
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

-- 
Sincerely yours
Mikhail Khludnev

Re: Intervals in Solr json request

Posted by Jason Gerlowski <ge...@gmail.com>.
Hi Mikhail,

I'm having trouble understanding the exact syntax you're proposing.
Is there a jira where the syntax is described in a little more detail?
 If not, would you care to put together a writeup on a jira somewhere?
 It's hard (for me at least) to weigh in as things are currently.

Best,

Jason

On Sun, Sep 8, 2019 at 3:25 PM Mikhail Khludnev <mk...@apache.org> wrote:
>
> Ok. It might be a parser referring to a json object under some new property
>
> {
>    "query": {
>            "jinterval":"just a name"  // introducing new QPPlugin
>       },
>    "jparams": {                       // introducing new top-level entry
>         "just a name": {
>               "or":[    "foo",
>                           "bar",
>                            { "unordered":
>                                     ["bag",
>                                       "baz",
>                                       "ban",
>                                        { "phrase": ["moo","foo"]}
>                                      ]
>                             }
>                       ],
>                "field":"text_content"
>              }
>      }
> }
>
> Can we consider it as a spec for the new feature?
>
> On Sun, Sep 8, 2019 at 12:16 AM Mikhail Khludnev <mk...@apache.org> wrote:
>>
>> Thanks for your warm responses. I encounter Intervals, and considering introducing them in Solr JSON Request API.
>> Following Query DSL approach gives me something like
>> "interval":{  "or":["foo",
>>                           "bar",
>>                            {"interval": { "unordered":
>>                                     ["bag",
>>                                       "baz",
>>                                       "ban",
>>                                        { "interval":{ "phrase": ["moo","foo"]} }
>>                                      ]}
>>                           }
>>                         ],
>>                    "field":"text_content"}
>> So, it implies creating {!inteval} query parser, which handles local param in a certain way, eg  it shouldn't support "or" and "phrase" an the same node.
>> Not sure how to propagate "filed" to term nodes.
>>
>> I'd rather want to have more control over syntax and JsonQueryConverter.
>>  "interval":{  "or":["foo",
>>                           "bar",
>>                            { "unordered":
>>                                     ["bag",
>>                                       "baz",
>>                                       "ban",
>>                                        { "phrase": ["moo","foo"]}
>>                                      ]}
>>                               }
>>                           ],
>>                    "field":"text_content"}
>>
>> Any ideas, preferences?
>>
>> On Sat, Sep 7, 2019 at 12:03 AM Mikhail Khludnev <mk...@apache.org> wrote:
>>>
>>> Hello,
>>>
>>> Finally we let users to send span queries via XML (yeah) query parser. But I feel awkward to invoke XML under Json. Straightforward approach lead us to bunch of span[Or|And|Not|Etc] QParser plugins. Are there any more elegant ideas?
>>>
>>> --
>>> Sincerely yours
>>> Mikhail Khludnev
>>
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Intervals in Solr json request

Posted by Mikhail Khludnev <mk...@apache.org>.
Ok. It might be a parser referring to a json object under some new property

{
   "query": {
           "jinterval":"just a name"  // introducing new QPPlugin
      },
   "jparams": {                       // introducing new top-level entry
        "just a name": {
              "or":[    "foo",
                          "bar",
                           { "unordered":
                                    ["bag",
                                      "baz",
                                      "ban",
                                       { "phrase": ["moo","foo"]}
                                     ]
                            }
                      ],
               "field":"text_content"
             }
     }
}

Can we consider it as a spec for the new feature?

On Sun, Sep 8, 2019 at 12:16 AM Mikhail Khludnev <mk...@apache.org> wrote:

> Thanks for your warm responses. I encounter Intervals, and considering
> introducing them in Solr JSON Request API.
> Following Query DSL approach gives me something like
> "interval":{  "or":["foo",
>                           "bar",
>                            {"interval": { "unordered":
>                                     ["bag",
>                                       "baz",
>                                       "ban",
>                                        { "interval":{ "phrase":
> ["moo","foo"]} }
>                                      ]}
>                           }
>                         ],
>                    "field":"text_content"}
> So, it implies creating {!inteval} query parser, which handles local param
> in a certain way, eg  it shouldn't support "or" and "phrase" an the same
> node.
> Not sure how to propagate "filed" to term nodes.
>
> I'd rather want to have more control over syntax and JsonQueryConverter.
>  "interval":{  "or":["foo",
>                           "bar",
>                            { "unordered":
>                                     ["bag",
>                                       "baz",
>                                       "ban",
>                                        { "phrase": ["moo","foo"]}
>                                      ]}
>                               }
>                           ],
>                    "field":"text_content"}
>
> Any ideas, preferences?
>
> On Sat, Sep 7, 2019 at 12:03 AM Mikhail Khludnev <mk...@apache.org> wrote:
>
>> Hello,
>>
>> Finally we let users to send span queries via XML (yeah) query parser.
>> But I feel awkward to invoke XML under Json. Straightforward approach lead
>> us to bunch of span[Or|And|Not|Etc] QParser plugins. Are there any more
>> elegant ideas?
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
Sincerely yours
Mikhail Khludnev

Re: Intervals in Solr json request

Posted by Mikhail Khludnev <mk...@apache.org>.
Thanks for your warm responses. I encounter Intervals, and considering
introducing them in Solr JSON Request API.
Following Query DSL approach gives me something like
"interval":{  "or":["foo",
                          "bar",
                           {"interval": { "unordered":
                                    ["bag",
                                      "baz",
                                      "ban",
                                       { "interval":{ "phrase":
["moo","foo"]} }
                                     ]}
                          }
                        ],
                   "field":"text_content"}
So, it implies creating {!inteval} query parser, which handles local param
in a certain way, eg  it shouldn't support "or" and "phrase" an the same
node.
Not sure how to propagate "filed" to term nodes.

I'd rather want to have more control over syntax and JsonQueryConverter.
 "interval":{  "or":["foo",
                          "bar",
                           { "unordered":
                                    ["bag",
                                      "baz",
                                      "ban",
                                       { "phrase": ["moo","foo"]}
                                     ]}
                              }
                          ],
                   "field":"text_content"}

Any ideas, preferences?

On Sat, Sep 7, 2019 at 12:03 AM Mikhail Khludnev <mk...@apache.org> wrote:

> Hello,
>
> Finally we let users to send span queries via XML (yeah) query parser. But
> I feel awkward to invoke XML under Json. Straightforward approach lead us
> to bunch of span[Or|And|Not|Etc] QParser plugins. Are there any more
> elegant ideas?
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
Sincerely yours
Mikhail Khludnev