Re: Date Query Using Local Params

2018-09-10 Thread Antelmo Aguilar
Hi Erik,

Thank you! I did mess with the v parameter, but I was doing it wrong.  I
was doing this v='([2013-07-08 TO 2013-07-09] OR [2013-07-21 TO
2013-07-25])'

Anyways, I needed to use the "fq" parameter and I did this fq=({!field
f=collection_date_range op=Within v='[2013-07-08 TO 2013-07-09]'} OR
{!field f=collection_date_range op=Within v='[2017-01-10 TO 2018-06-17]'})
and it worked like I would expect.

Thank you for all your help!

Best,
Antelmo

On Mon, Sep 10, 2018 at 4:18 PM, Erik Hatcher 
wrote:

> When using the {!...} syntax, and combining it with other clauses, the
> expression parsed needs to come from a local-param `v` parameter
> (otherwise, without `v`, the parser eats the rest of the string after the
> closing curly bracket).  So you could do something like this:
>
>
> q={!field f=collection_date_range op=Within v='[2013-07-08 TO
> 2013-07-09]'} OR {!field
> f=collection_date_range op=Within v='[2013-07-21 TO 2013-07-25]'}
>
> Or you could do this sort of thing, which allows the date ranges to be
> parameterized:
>
> q={!field f=collection_date_range op=Within v=$range1} OR {!field
> f=collection_date_range op=Within v=$range2}
>  =[2013-07-08 TO 2013-07-09]
>  =[2013-07-21 TO 2013-07-25]
>
> Erik
>
>
>
>
>
> > On Sep 10, 2018, at 3:59 PM, Antelmo Aguilar  wrote:
> >
> > Hi Shawn,
> >
> > Thank you.  So just to confirm, there is no way for me to use an OR
> > operator with also using the "within" op parameter described in the
> bottom
> > of this page?
> >
> > https://lucene.apache.org/solr/guide/6_6/working-with-
> dates.html#WorkingwithDates-MoreDateRangeFieldDetails
> >
> > I appreciate your resposne.
> >
> > Best,
> > Antelmo
> >
> > On Mon, Sep 10, 2018 at 3:51 PM, Shawn Heisey 
> wrote:
> >
> >> On 9/10/2018 1:21 PM, Antelmo Aguilar wrote:
> >>
> >>> Hi,
> >>>
> >>> I have a question.  I am trying to use the "within" op parameter in a
> Date
> >>> Search.  This works like I would expect: {!field
> f=collection_date_range
> >>> op=Within}[2013-07-08 TO 2013-07-09]
> >>>
> >>> I would like to use an OR with the query though, something like this:
> >>> {!field
> >>> f=collection_date_range op=Within}[2013-07-08 TO 2013-07-09] OR {!field
> >>> f=collection_date_range op=Within}[2013-07-21 TO 2013-07-25]
> >>>
> >>> However, I tried different approaches and none of them worked.  Is
> there a
> >>> way of doing something like this for querying dates using the "within"
> op
> >>> parameter?
> >>>
> >>
> >> I don't think the field parser can do this.  Also, usually it's not
> >> possible to use localparams in a second query clause like that --
> >> localparams must almost always be the very first thing in the "q"
> >> parameter, or they will not be interpreted as localparams.  Use the
> >> standard (lucene) parser without localparams.  The q parameter should
> look
> >> like this:
> >>
> >> collection_date_range:[2013-07-08 TO 2013-07-09] OR
> >> collection_date_range:[2013-07-21 TO 2013-07-25]
> >>
> >> If the default operator hasn't been changed (which would mean it is
> using
> >> OR), then you could remove the "OR" from that.
> >>
> >> Thanks,
> >> Shawn
> >>
> >>
>
>


Re: Date Query Using Local Params

2018-09-10 Thread Erik Hatcher
When using the {!...} syntax, and combining it with other clauses, the 
expression parsed needs to come from a local-param `v` parameter (otherwise, 
without `v`, the parser eats the rest of the string after the closing curly 
bracket).  So you could do something like this:


q={!field f=collection_date_range op=Within v='[2013-07-08 TO 2013-07-09]'} 
OR {!field
f=collection_date_range op=Within v='[2013-07-21 TO 2013-07-25]'}

Or you could do this sort of thing, which allows the date ranges to be 
parameterized:

q={!field f=collection_date_range op=Within v=$range1} OR {!field
f=collection_date_range op=Within v=$range2}
 =[2013-07-08 TO 2013-07-09]
 =[2013-07-21 TO 2013-07-25]

Erik





> On Sep 10, 2018, at 3:59 PM, Antelmo Aguilar  wrote:
> 
> Hi Shawn,
> 
> Thank you.  So just to confirm, there is no way for me to use an OR
> operator with also using the "within" op parameter described in the bottom
> of this page?
> 
> https://lucene.apache.org/solr/guide/6_6/working-with-dates.html#WorkingwithDates-MoreDateRangeFieldDetails
> 
> I appreciate your resposne.
> 
> Best,
> Antelmo
> 
> On Mon, Sep 10, 2018 at 3:51 PM, Shawn Heisey  wrote:
> 
>> On 9/10/2018 1:21 PM, Antelmo Aguilar wrote:
>> 
>>> Hi,
>>> 
>>> I have a question.  I am trying to use the "within" op parameter in a Date
>>> Search.  This works like I would expect: {!field f=collection_date_range
>>> op=Within}[2013-07-08 TO 2013-07-09]
>>> 
>>> I would like to use an OR with the query though, something like this:
>>> {!field
>>> f=collection_date_range op=Within}[2013-07-08 TO 2013-07-09] OR {!field
>>> f=collection_date_range op=Within}[2013-07-21 TO 2013-07-25]
>>> 
>>> However, I tried different approaches and none of them worked.  Is there a
>>> way of doing something like this for querying dates using the "within" op
>>> parameter?
>>> 
>> 
>> I don't think the field parser can do this.  Also, usually it's not
>> possible to use localparams in a second query clause like that --
>> localparams must almost always be the very first thing in the "q"
>> parameter, or they will not be interpreted as localparams.  Use the
>> standard (lucene) parser without localparams.  The q parameter should look
>> like this:
>> 
>> collection_date_range:[2013-07-08 TO 2013-07-09] OR
>> collection_date_range:[2013-07-21 TO 2013-07-25]
>> 
>> If the default operator hasn't been changed (which would mean it is using
>> OR), then you could remove the "OR" from that.
>> 
>> Thanks,
>> Shawn
>> 
>> 



Re: Date Query Using Local Params

2018-09-10 Thread Antelmo Aguilar
Hi Shawn,

Thank you.  So just to confirm, there is no way for me to use an OR
operator with also using the "within" op parameter described in the bottom
of this page?

https://lucene.apache.org/solr/guide/6_6/working-with-dates.html#WorkingwithDates-MoreDateRangeFieldDetails

I appreciate your resposne.

Best,
Antelmo

On Mon, Sep 10, 2018 at 3:51 PM, Shawn Heisey  wrote:

> On 9/10/2018 1:21 PM, Antelmo Aguilar wrote:
>
>> Hi,
>>
>> I have a question.  I am trying to use the "within" op parameter in a Date
>> Search.  This works like I would expect: {!field f=collection_date_range
>> op=Within}[2013-07-08 TO 2013-07-09]
>>
>> I would like to use an OR with the query though, something like this:
>> {!field
>> f=collection_date_range op=Within}[2013-07-08 TO 2013-07-09] OR {!field
>> f=collection_date_range op=Within}[2013-07-21 TO 2013-07-25]
>>
>> However, I tried different approaches and none of them worked.  Is there a
>> way of doing something like this for querying dates using the "within" op
>> parameter?
>>
>
> I don't think the field parser can do this.  Also, usually it's not
> possible to use localparams in a second query clause like that --
> localparams must almost always be the very first thing in the "q"
> parameter, or they will not be interpreted as localparams.  Use the
> standard (lucene) parser without localparams.  The q parameter should look
> like this:
>
> collection_date_range:[2013-07-08 TO 2013-07-09] OR
> collection_date_range:[2013-07-21 TO 2013-07-25]
>
> If the default operator hasn't been changed (which would mean it is using
> OR), then you could remove the "OR" from that.
>
> Thanks,
> Shawn
>
>


Re: Date Query Using Local Params

2018-09-10 Thread Shawn Heisey

On 9/10/2018 1:21 PM, Antelmo Aguilar wrote:

Hi,

I have a question.  I am trying to use the "within" op parameter in a Date
Search.  This works like I would expect: {!field f=collection_date_range
op=Within}[2013-07-08 TO 2013-07-09]

I would like to use an OR with the query though, something like this: {!field
f=collection_date_range op=Within}[2013-07-08 TO 2013-07-09] OR {!field
f=collection_date_range op=Within}[2013-07-21 TO 2013-07-25]

However, I tried different approaches and none of them worked.  Is there a
way of doing something like this for querying dates using the "within" op
parameter?


I don't think the field parser can do this.  Also, usually it's not 
possible to use localparams in a second query clause like that -- 
localparams must almost always be the very first thing in the "q" 
parameter, or they will not be interpreted as localparams.  Use the 
standard (lucene) parser without localparams.  The q parameter should 
look like this:


collection_date_range:[2013-07-08 TO 2013-07-09] OR 
collection_date_range:[2013-07-21 TO 2013-07-25]


If the default operator hasn't been changed (which would mean it is 
using OR), then you could remove the "OR" from that.


Thanks,
Shawn



Date Query Using Local Params

2018-09-10 Thread Antelmo Aguilar
Hi,

I have a question.  I am trying to use the "within" op parameter in a Date
Search.  This works like I would expect: {!field f=collection_date_range
op=Within}[2013-07-08 TO 2013-07-09]

I would like to use an OR with the query though, something like this: {!field
f=collection_date_range op=Within}[2013-07-08 TO 2013-07-09] OR {!field
f=collection_date_range op=Within}[2013-07-21 TO 2013-07-25]

However, I tried different approaches and none of them worked.  Is there a
way of doing something like this for querying dates using the "within" op
parameter?

Thanks,
Antelmo


Re: Negative Date Query for Local Params in Solr

2016-09-20 Thread Sandeep Khanzode
Thanks, David! Perhaps browsing the Solr sources may be a necessity at some 
point in time. :) SRK 

On Wednesday, September 21, 2016 9:08 AM, David Smiley 
 wrote:
 

 So that page referenced describes local-params, and describes the special
"v" local-param.  But first, see a list of all query parsers (which lists
"field"): https://cwiki.apache.org/confluence/display/solr/Other+Parsers
and
https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser for
the "lucene" one.

The "op" param is rather unique... it's not defined by any query parser.  A
trick is done in which a custom field type (DateRangeField in this case) is
able to inspect the local-params, and thus define and use params it needs.
https://cwiki.apache.org/confluence/display/solr/Working+with+Dates "More
DateRangeField Details" mentions "op".  {!lucene df=dateRange
op=Contains}... would also work.  I don't know of any other local-param
used in this way.

On Tue, Sep 20, 2016 at 11:21 PM David Smiley 
wrote:

> Personally I learned this by pouring over Solr's source code some time
> ago.  I suppose the only official reference to this stuff is:
>
> https://cwiki.apache.org/confluence/display/solr/Local+Parameters+in+Queries
> But that page doesn't address the implications for when the syntax is a
> clause of a larger query instead of being the whole query (i.e. has "{!"...
> but but not at the first char).
>
> On Tue, Sep 20, 2016 at 2:06 PM Sandeep Khanzode
>  wrote:
>
>> Wow. Simply awesome!
>> Where can I read more about this? I am not sure whether I understand what
>> is going on behind the scenes ... like which parser is invoked for !field,
>> how can we know which all special local params exist, whether we should
>> prefer edismax over others, when is the LuceneQParser invoked in other
>> conditions, etc? Would appreciate if you could indicate some references to
>> catch up.
>> Thanks a lot ...  SRK
>>
>>  Show original message    On Tuesday, September 20, 2016 5:54 PM, David
>> Smiley  wrote:
>>
>>
>>  OH!  Ok the moment the query no longer starts with "{!", the query is
>> parsed by defType (for 'q') and will default to lucene QParser.  So then
>> it
>> appears we have a clause with a NOT operator.  In this parsing mode,
>> embedded "{!" terminates at the "}".  This means you can't put the
>> sub-query text after the "}", you instead need to put it in the special
>> "v"
>> local-param.  e.g.:
>> -{!field f=schedule op=Contains v='[2016-08-26T12:00:12Z TO
>> 2016-08-26T15:00:12Z]'}
>>
>> On Tue, Sep 20, 2016 at 8:15 AM Sandeep Khanzode
>>  wrote:
>>
>> > This is what I get ...
>> > { "responseHeader": { "status": 400, "QTime": 1, "params": { "q":
>> > "-{!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
>> > 2016-08-26T15:00:12Z]", "indent": "true", "wt": "json", "_":
>> > "1474373612202" } }, "error": { "msg": "Invalid Date in Date Math
>> > String:'[2016-08-26T12:00:12Z'", "code": 400 }}
>> >  SRK
>> >
>> >    On Tuesday, September 20, 2016 5:34 PM, David Smiley <
>> > david.w.smi...@gmail.com> wrote:
>> >
>> >
>> >  It should, I think... what happens? Can you ascertain the nature of the
>> > results?
>> > ~ David
>> >
>> > On Tue, Sep 20, 2016 at 5:35 AM Sandeep Khanzode
>> >  wrote:
>> >
>> > > For Solr 6.1.0
>> > > This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z
>> > >
>> > > This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
>> > > 2016-08-26T15:00:12Z]
>> > >
>> > >
>> > > Why does this not work?-{!field f=schedule
>> > > op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]
>> > >  SRK
>> >
>> > --
>> > Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
>> > LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
>> > http://www.solrenterprisesearchserver.com
>> >
>> >
>> >
>>
>> --
>> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
>> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
>> http://www.solrenterprisesearchserver.com
>>
>>
>>
>
> --
> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> http://www.solrenterprisesearchserver.com
>
-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


   

Re: Negative Date Query for Local Params in Solr

2016-09-20 Thread David Smiley
So that page referenced describes local-params, and describes the special
"v" local-param.  But first, see a list of all query parsers (which lists
"field"): https://cwiki.apache.org/confluence/display/solr/Other+Parsers
and
https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser for
the "lucene" one.

The "op" param is rather unique... it's not defined by any query parser.  A
trick is done in which a custom field type (DateRangeField in this case) is
able to inspect the local-params, and thus define and use params it needs.
https://cwiki.apache.org/confluence/display/solr/Working+with+Dates "More
DateRangeField Details" mentions "op".  {!lucene df=dateRange
op=Contains}... would also work.  I don't know of any other local-param
used in this way.

On Tue, Sep 20, 2016 at 11:21 PM David Smiley 
wrote:

> Personally I learned this by pouring over Solr's source code some time
> ago.  I suppose the only official reference to this stuff is:
>
> https://cwiki.apache.org/confluence/display/solr/Local+Parameters+in+Queries
> But that page doesn't address the implications for when the syntax is a
> clause of a larger query instead of being the whole query (i.e. has "{!"...
> but but not at the first char).
>
> On Tue, Sep 20, 2016 at 2:06 PM Sandeep Khanzode
>  wrote:
>
>> Wow. Simply awesome!
>> Where can I read more about this? I am not sure whether I understand what
>> is going on behind the scenes ... like which parser is invoked for !field,
>> how can we know which all special local params exist, whether we should
>> prefer edismax over others, when is the LuceneQParser invoked in other
>> conditions, etc? Would appreciate if you could indicate some references to
>> catch up.
>> Thanks a lot ...  SRK
>>
>>   Show original message On Tuesday, September 20, 2016 5:54 PM, David
>> Smiley  wrote:
>>
>>
>>  OH!  Ok the moment the query no longer starts with "{!", the query is
>> parsed by defType (for 'q') and will default to lucene QParser.  So then
>> it
>> appears we have a clause with a NOT operator.  In this parsing mode,
>> embedded "{!" terminates at the "}".  This means you can't put the
>> sub-query text after the "}", you instead need to put it in the special
>> "v"
>> local-param.  e.g.:
>> -{!field f=schedule op=Contains v='[2016-08-26T12:00:12Z TO
>> 2016-08-26T15:00:12Z]'}
>>
>> On Tue, Sep 20, 2016 at 8:15 AM Sandeep Khanzode
>>  wrote:
>>
>> > This is what I get ...
>> > { "responseHeader": { "status": 400, "QTime": 1, "params": { "q":
>> > "-{!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
>> > 2016-08-26T15:00:12Z]", "indent": "true", "wt": "json", "_":
>> > "1474373612202" } }, "error": { "msg": "Invalid Date in Date Math
>> > String:'[2016-08-26T12:00:12Z'", "code": 400 }}
>> >  SRK
>> >
>> >On Tuesday, September 20, 2016 5:34 PM, David Smiley <
>> > david.w.smi...@gmail.com> wrote:
>> >
>> >
>> >  It should, I think... what happens? Can you ascertain the nature of the
>> > results?
>> > ~ David
>> >
>> > On Tue, Sep 20, 2016 at 5:35 AM Sandeep Khanzode
>> >  wrote:
>> >
>> > > For Solr 6.1.0
>> > > This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z
>> > >
>> > > This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
>> > > 2016-08-26T15:00:12Z]
>> > >
>> > >
>> > > Why does this not work?-{!field f=schedule
>> > > op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]
>> > >  SRK
>> >
>> > --
>> > Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
>> > LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
>> > http://www.solrenterprisesearchserver.com
>> >
>> >
>> >
>>
>> --
>> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
>> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
>> http://www.solrenterprisesearchserver.com
>>
>>
>>
>
> --
> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> http://www.solrenterprisesearchserver.com
>
-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


Re: Negative Date Query for Local Params in Solr

2016-09-20 Thread David Smiley
Personally I learned this by pouring over Solr's source code some time
ago.  I suppose the only official reference to this stuff is:
https://cwiki.apache.org/confluence/display/solr/Local+Parameters+in+Queries
But that page doesn't address the implications for when the syntax is a
clause of a larger query instead of being the whole query (i.e. has "{!"...
but but not at the first char).

On Tue, Sep 20, 2016 at 2:06 PM Sandeep Khanzode
 wrote:

> Wow. Simply awesome!
> Where can I read more about this? I am not sure whether I understand what
> is going on behind the scenes ... like which parser is invoked for !field,
> how can we know which all special local params exist, whether we should
> prefer edismax over others, when is the LuceneQParser invoked in other
> conditions, etc? Would appreciate if you could indicate some references to
> catch up.
> Thanks a lot ...  SRK
>
>   Show original message On Tuesday, September 20, 2016 5:54 PM, David
> Smiley  wrote:
>
>
>  OH!  Ok the moment the query no longer starts with "{!", the query is
> parsed by defType (for 'q') and will default to lucene QParser.  So then it
> appears we have a clause with a NOT operator.  In this parsing mode,
> embedded "{!" terminates at the "}".  This means you can't put the
> sub-query text after the "}", you instead need to put it in the special "v"
> local-param.  e.g.:
> -{!field f=schedule op=Contains v='[2016-08-26T12:00:12Z TO
> 2016-08-26T15:00:12Z]'}
>
> On Tue, Sep 20, 2016 at 8:15 AM Sandeep Khanzode
>  wrote:
>
> > This is what I get ...
> > { "responseHeader": { "status": 400, "QTime": 1, "params": { "q":
> > "-{!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> > 2016-08-26T15:00:12Z]", "indent": "true", "wt": "json", "_":
> > "1474373612202" } }, "error": { "msg": "Invalid Date in Date Math
> > String:'[2016-08-26T12:00:12Z'", "code": 400 }}
> >  SRK
> >
> >On Tuesday, September 20, 2016 5:34 PM, David Smiley <
> > david.w.smi...@gmail.com> wrote:
> >
> >
> >  It should, I think... what happens? Can you ascertain the nature of the
> > results?
> > ~ David
> >
> > On Tue, Sep 20, 2016 at 5:35 AM Sandeep Khanzode
> >  wrote:
> >
> > > For Solr 6.1.0
> > > This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z
> > >
> > > This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> > > 2016-08-26T15:00:12Z]
> > >
> > >
> > > Why does this not work?-{!field f=schedule
> > > op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]
> > >  SRK
> >
> > --
> > Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> > LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> > http://www.solrenterprisesearchserver.com
> >
> >
> >
>
> --
> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> http://www.solrenterprisesearchserver.com
>
>
>

-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


Re: Negative Date Query for Local Params in Solr

2016-09-20 Thread Sandeep Khanzode
Wow. Simply awesome!
Where can I read more about this? I am not sure whether I understand what is 
going on behind the scenes ... like which parser is invoked for !field, how can 
we know which all special local params exist, whether we should prefer edismax 
over others, when is the LuceneQParser invoked in other conditions, etc? Would 
appreciate if you could indicate some references to catch up. 
Thanks a lot ...  SRK 

  Show original message On Tuesday, September 20, 2016 5:54 PM, David 
Smiley  wrote:
 

 OH!  Ok the moment the query no longer starts with "{!", the query is
parsed by defType (for 'q') and will default to lucene QParser.  So then it
appears we have a clause with a NOT operator.  In this parsing mode,
embedded "{!" terminates at the "}".  This means you can't put the
sub-query text after the "}", you instead need to put it in the special "v"
local-param.  e.g.:
-{!field f=schedule op=Contains v='[2016-08-26T12:00:12Z TO
2016-08-26T15:00:12Z]'}

On Tue, Sep 20, 2016 at 8:15 AM Sandeep Khanzode
 wrote:

> This is what I get ...
> { "responseHeader": { "status": 400, "QTime": 1, "params": { "q":
> "-{!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> 2016-08-26T15:00:12Z]", "indent": "true", "wt": "json", "_":
> "1474373612202" } }, "error": { "msg": "Invalid Date in Date Math
> String:'[2016-08-26T12:00:12Z'", "code": 400 }}
>  SRK
>
>    On Tuesday, September 20, 2016 5:34 PM, David Smiley <
> david.w.smi...@gmail.com> wrote:
>
>
>  It should, I think... what happens? Can you ascertain the nature of the
> results?
> ~ David
>
> On Tue, Sep 20, 2016 at 5:35 AM Sandeep Khanzode
>  wrote:
>
> > For Solr 6.1.0
> > This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z
> >
> > This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> > 2016-08-26T15:00:12Z]
> >
> >
> > Why does this not work?-{!field f=schedule
> > op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]
> >  SRK
>
> --
> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> http://www.solrenterprisesearchserver.com
>
>
>

-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


   

Re: Negative Date Query for Local Params in Solr

2016-09-20 Thread David Smiley
OH!  Ok the moment the query no longer starts with "{!", the query is
parsed by defType (for 'q') and will default to lucene QParser.  So then it
appears we have a clause with a NOT operator.  In this parsing mode,
embedded "{!" terminates at the "}".  This means you can't put the
sub-query text after the "}", you instead need to put it in the special "v"
local-param.  e.g.:
-{!field f=schedule op=Contains v='[2016-08-26T12:00:12Z TO
2016-08-26T15:00:12Z]'}

On Tue, Sep 20, 2016 at 8:15 AM Sandeep Khanzode
 wrote:

> This is what I get ...
> { "responseHeader": { "status": 400, "QTime": 1, "params": { "q":
> "-{!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> 2016-08-26T15:00:12Z]", "indent": "true", "wt": "json", "_":
> "1474373612202" } }, "error": { "msg": "Invalid Date in Date Math
> String:'[2016-08-26T12:00:12Z'", "code": 400 }}
>  SRK
>
> On Tuesday, September 20, 2016 5:34 PM, David Smiley <
> david.w.smi...@gmail.com> wrote:
>
>
>  It should, I think... what happens? Can you ascertain the nature of the
> results?
> ~ David
>
> On Tue, Sep 20, 2016 at 5:35 AM Sandeep Khanzode
>  wrote:
>
> > For Solr 6.1.0
> > This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z
> >
> > This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> > 2016-08-26T15:00:12Z]
> >
> >
> > Why does this not work?-{!field f=schedule
> > op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]
> >  SRK
>
> --
> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> http://www.solrenterprisesearchserver.com
>
>
>

-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


Re: Negative Date Query for Local Params in Solr

2016-09-20 Thread Sandeep Khanzode
This is what I get ... 
{ "responseHeader": { "status": 400, "QTime": 1, "params": { "q": "-{!field 
f=schedule op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]", 
"indent": "true", "wt": "json", "_": "1474373612202" } }, "error": { "msg": 
"Invalid Date in Date Math String:'[2016-08-26T12:00:12Z'", "code": 400 }}
 SRK 

On Tuesday, September 20, 2016 5:34 PM, David Smiley 
 wrote:
 

 It should, I think... what happens? Can you ascertain the nature of the
results?
~ David

On Tue, Sep 20, 2016 at 5:35 AM Sandeep Khanzode
 wrote:

> For Solr 6.1.0
> This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z
>
> This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> 2016-08-26T15:00:12Z]
>
>
> Why does this not work?-{!field f=schedule
> op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]
>  SRK

-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


   

Re: Negative Date Query for Local Params in Solr

2016-09-20 Thread David Smiley
It should, I think... what happens? Can you ascertain the nature of the
results?
~ David

On Tue, Sep 20, 2016 at 5:35 AM Sandeep Khanzode
 wrote:

> For Solr 6.1.0
> This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z
>
> This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO
> 2016-08-26T15:00:12Z]
>
>
> Why does this not work?-{!field f=schedule
> op=Contains}[2016-08-26T12:00:12Z TO 2016-08-26T15:00:12Z]
>  SRK

-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


Negative Date Query for Local Params in Solr

2016-09-20 Thread Sandeep Khanzode
For Solr 6.1.0
This works .. -{!field f=schedule op=Intersects}2016-08-26T12:00:56Z

This works .. {!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO 
2016-08-26T15:00:12Z]


Why does this not work?-{!field f=schedule op=Contains}[2016-08-26T12:00:12Z TO 
2016-08-26T15:00:12Z]
 SRK

query with local params

2014-03-11 Thread Andreas Owen
This works great but i would like to use lacal params r and org instead of 
hard-coded
str name=fq (*:* -organisations:[* TO *] -roles:[* TO *]) 
(+organisations:(150 42) +roles:(174 72))

I would like
str name=fq (*:* -organisations:[* TO *] -roles:[* TO *]) 
(+organisations:($org) +roles:($r))

Shouldn't the numbers be in the output below (parsed_filter_queries) and not $r 
and $org? I use this in my requesthandler and need it to be added as fq or 
query params without being able to be overriden, has anybody any idees? Oh and 
i use facets so fq has to be combinable.

Debug query:

lst name=responseHeader
  int name=status0/int
  int name=QTime109/int
  lst name=params
str name=debugQuerytrue/str
str name=indenttrue/str
str name=r267/str
str name=qyh_cug/str
str name=_1394533792473/str
str name=wtxml/str
  /lst
...
arr name=filter_queries
str{!q.op=OR} (*:* -organisations:[ TO *] -roles:[ TO *]) 
(+organisations:($org) +roles:($r)) (-organisations:[ TO *] +roles:($r)) 
(+organisations:($org) -roles:[ TO *])/str
  /arr
  arr name=parsed_filter_queries
str(MatchAllDocsQuery(*:*) -organisations:[ TO *] -roles:[ TO *]) 
(+organisations:$org +roles:$r) (-organisations:[ TO *] +roles:$r) 
(+organisations:$org -roles:[ TO *])/str
  /arr