You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Steven White <sw...@gmail.com> on 2016/06/08 20:28:44 UTC

Question about multiple fq parameters

Hi everyone,

I cannot make sense of this so I hope someone here can shed some light.

The following gives me 0 hits (expected):

  ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]

The following gives me hits (expected):

  ?q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]

But the following (combine the above two) gives me 0 hits (unexpected):

  ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]

What am I missing?

Thanks.

Steve

Re: Question about multiple fq parameters

Posted by Erick Erickson <er...@gmail.com>.
I took a quick look and basically the key is that these are _ranges_
both at index and query time.
Each value in the doc is a range of dates.

I _think_ it's something like this.

contains = Some date range in the document contains the entire
                  range in the query.
within = All date ranges in the doc are entirely within the
             range of the query
intersect = at least one range in the doc has one date in common with
the range in the query.

Graphically I think it's like this. Docs with two bars are multiValued.

*****contains finds
doc         -------     ----------
query        ---

doc      ------------------
query      ---------

NOT found
doc      -----------          -------------
query       -------------------

doc     -------------   -------------
query                                         --------------


******within finds
doc          ---------------    ------------
query --------------------------------------

doc         ------------
query ---------------------

NOT found
doc         -----------        ---------------
query   --------------------------

doc        -----------------       -----------------
query                                                         ----------------

******intersects
doc         --------------
query --------

doc   --------------
query        ------------

doc       --------------
query        ----

NOT found
doc       ---------------
query                          ------------

NOTE, this is a little tricky to get your head around since a
dateRange field in a doc
has implicit lower bounds and upper bounds, i.e.
like [1980 TO 1981] is _two_ years,
1980-01-01T00:00:00Z TO 1981-12-31T23:23:59,999

Cool Stuff!

Erick

On Fri, Jun 10, 2016 at 12:56 AM, Mikhail Khludnev
<mk...@griddynamics.com> wrote:
> Ahmet,
>
> Honestly I don't know, but googling gives:
> More DateRangeField Details
> https://cwiki.apache.org/confluence/display/solr/Working+with+Dates
>
> On Fri, Jun 10, 2016 at 3:44 AM, Ahmet Arslan <io...@yahoo.com.invalid>
> wrote:
>
>> Hi Mikhail,
>>
>> Can you please explain what this mysterious op parameter is?
>> How is it related to range queries issued on date fields?
>>
>> Thanks,
>> Ahmet
>>
>>
>> On Thursday, June 9, 2016 11:43 AM, Mikhail Khludnev <
>> mkhludnev@griddynamics.com> wrote:
>> Shawn,
>> I found "op" at
>> org.apache.solr.schema.DateRangeField.parseSpatialArgs(QParser, String).
>>
>>
>> On Thu, Jun 9, 2016 at 1:46 AM, Shawn Heisey <ap...@elyograg.org> wrote:
>>
>> > On 6/8/2016 2:28 PM, Steven White wrote:
>> > >
>> ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>> >
>> > Looking at this and checking the code for the Field query parser, I
>> > cannot see how what you have used above is any different than:
>> >
>> > fq=DateA:[2020-01-01 TO 2030-01-01]
>> >
>> > The "op=Intersects" parameter that you have included appears to be
>> > ignored by the parser code that I examined.
>> >
>> > If my understanding of the documentation and the code is correct, then
>> > you should be able to use this:
>> >
>> > fq=DateB:[2000-01-01 TO 2020-01-01] OR DateA:[2020-01-01 TO 2030-01-01]
>> >
>> > In my examples I have changed the URL encoded "+" character back to a
>> > regular space.
>> >
>> > Thanks,
>> > Shawn
>> >
>> >
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>> Principal Engineer,
>> Grid Dynamics
>>
>> <http://www.griddynamics.com>
>> <mkhludnev@griddynamics.com
>> >
>>
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>

Re: Question about multiple fq parameters

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Ahmet,

Honestly I don't know, but googling gives:
More DateRangeField Details
https://cwiki.apache.org/confluence/display/solr/Working+with+Dates

On Fri, Jun 10, 2016 at 3:44 AM, Ahmet Arslan <io...@yahoo.com.invalid>
wrote:

> Hi Mikhail,
>
> Can you please explain what this mysterious op parameter is?
> How is it related to range queries issued on date fields?
>
> Thanks,
> Ahmet
>
>
> On Thursday, June 9, 2016 11:43 AM, Mikhail Khludnev <
> mkhludnev@griddynamics.com> wrote:
> Shawn,
> I found "op" at
> org.apache.solr.schema.DateRangeField.parseSpatialArgs(QParser, String).
>
>
> On Thu, Jun 9, 2016 at 1:46 AM, Shawn Heisey <ap...@elyograg.org> wrote:
>
> > On 6/8/2016 2:28 PM, Steven White wrote:
> > >
> ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
> >
> > Looking at this and checking the code for the Field query parser, I
> > cannot see how what you have used above is any different than:
> >
> > fq=DateA:[2020-01-01 TO 2030-01-01]
> >
> > The "op=Intersects" parameter that you have included appears to be
> > ignored by the parser code that I examined.
> >
> > If my understanding of the documentation and the code is correct, then
> > you should be able to use this:
> >
> > fq=DateB:[2000-01-01 TO 2020-01-01] OR DateA:[2020-01-01 TO 2030-01-01]
> >
> > In my examples I have changed the URL encoded "+" character back to a
> > regular space.
> >
> > Thanks,
> > Shawn
> >
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mkhludnev@griddynamics.com
> >
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Question about multiple fq parameters

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi Mikhail,

Can you please explain what this mysterious op parameter is?
How is it related to range queries issued on date fields?

Thanks,
Ahmet


On Thursday, June 9, 2016 11:43 AM, Mikhail Khludnev <mk...@griddynamics.com> wrote:
Shawn,
I found "op" at
org.apache.solr.schema.DateRangeField.parseSpatialArgs(QParser, String).


On Thu, Jun 9, 2016 at 1:46 AM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/8/2016 2:28 PM, Steven White wrote:
> > ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>
> Looking at this and checking the code for the Field query parser, I
> cannot see how what you have used above is any different than:
>
> fq=DateA:[2020-01-01 TO 2030-01-01]
>
> The "op=Intersects" parameter that you have included appears to be
> ignored by the parser code that I examined.
>
> If my understanding of the documentation and the code is correct, then
> you should be able to use this:
>
> fq=DateB:[2000-01-01 TO 2020-01-01] OR DateA:[2020-01-01 TO 2030-01-01]
>
> In my examples I have changed the URL encoded "+" character back to a
> regular space.
>
> Thanks,
> Shawn
>
>


-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mkhludnev@griddynamics.com
>

Re: Question about multiple fq parameters

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Shawn,
I found "op" at
org.apache.solr.schema.DateRangeField.parseSpatialArgs(QParser, String).

On Thu, Jun 9, 2016 at 1:46 AM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/8/2016 2:28 PM, Steven White wrote:
> > ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>
> Looking at this and checking the code for the Field query parser, I
> cannot see how what you have used above is any different than:
>
> fq=DateA:[2020-01-01 TO 2030-01-01]
>
> The "op=Intersects" parameter that you have included appears to be
> ignored by the parser code that I examined.
>
> If my understanding of the documentation and the code is correct, then
> you should be able to use this:
>
> fq=DateB:[2000-01-01 TO 2020-01-01] OR DateA:[2020-01-01 TO 2030-01-01]
>
> In my examples I have changed the URL encoded "+" character back to a
> regular space.
>
> Thanks,
> Shawn
>
>


-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Question about multiple fq parameters

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Steve,
It's hard to debug queries in this way. Try to experiment with
debugQuery=true, pulling fq to q, just for explanation, etc.

On Thu, Jun 9, 2016 at 5:08 PM, Steven White <sw...@gmail.com> wrote:

> Erick, Mikhail, and Shawn, thank you all for your help.
>
>
>
> Just a quick re-cap of what I’m trying to achieve: my need is to combine 2
> or more “fq” queries to be treated as OR.
>
>
>
> Erick, Mikhail, I have the syntax you provided but I cannot get them to
> work properly, in fact I’m seeing odd behavior that I cannot explain so I
> hope you can shed some light on them.
>
>
>
> The following give me hits as expected:
>
>
>
> 1269 hits:
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateA+v=$a}+{!field+f=DateB+v=$b}+
>
> &a=[2000-01-01+TO+2030-01-01]&b=[2000-01-01+TO+2030-01-01]
>
>
>
> 1269 hits:
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateA+v=$a}+
>
> &a=[2000-01-01+TO+2030-01-01]
>
>
>
> 905 hits:
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateB+v=$b}+
>
> &b=[2000-01-01+TO+2030-01-01]
>
>
>
> The following don’t give me a hit as expected:
>
>
>
> 0 hits:
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateA+v=$a}+
>
> &a=[2020-01-01+TO+2030-01-01]
>
>
>
> 0 hits:
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateB+v=$b}+
>
> &b=[2020-01-01+TO+2030-01-01]
>
>
>
> The next 3 syntax are odd behavior that I cannot explain:
>
>
>
> A) 1269 hits (expected):
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateA+v=$a}+{!field+f=DateB+v=$b}+
>
> &a=[2000-01-01+TO+2030-01-01]&b=[2020-01-01+TO+2030-01-01]
>
>
>
> B) 905 hits (odd result):
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateB+v=$a}+{!field+f=DateA+v=$b}+
>
> &a=[2000-01-01+TO+2030-01-01]&b=[2020-01-01+TO+2030-01-01]
>
>
>
> C) 0 hits (but why?!):
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateA+v=$a}+{!field+f=DateB+v=$b}+
>
> &a=[2020-01-01+TO+2030-01-01]&b=[2000-01-01+TO+2030-01-01]
>
>
>
> D) 0 hits (but why?!):
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> {!field+f=DateB+v=$a}+{!field+f=DateA+v=$b}+
>
> &a=[2020-01-01+TO+2030-01-01]&b=[2000-01-01+TO+2030-01-01]
>
>
>
> Since my goal here is to have fq apply OR on the two date searches, test B
> clearly shows that’s not the case and test C & D shows that fq is ignoring
> the second part in the query.
>
>
>
> I also tried this syntax:
>
>
>
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> filter({!field+f=DateA+op=Intersects}[2000-01-01+TO+2020-01-01])+
>
> filter({!field+f=DateB+op=Intersects}[2000-01-01+TO+2030-01-01])
>
>
>
> But Solr is reporting an error: “no field name specified in query and no
> default specified via 'df' param”.
>
>
>
> Shawn, using the syntax that you suggested everything works (including my
> mix date range tests of the above):
>
>
>
>
> http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=
>
> DateA:[2000-01-01+TO+2030-01-01]+OR+DateB:[2000-01-01 TO 2030-01-01]
>
>
>
> My motivation to use “{!field}[]” in fq was what I read somewhere (I cannot
> find it now, even after many Google’s on it) is far faster and efficient
> than the tradition <Field-Name>:[value]
>
>
>
> Steve
>
> On Wed, Jun 8, 2016 at 6:46 PM, Shawn Heisey <ap...@elyograg.org> wrote:
>
> > On 6/8/2016 2:28 PM, Steven White wrote:
> > >
> ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
> >
> > Looking at this and checking the code for the Field query parser, I
> > cannot see how what you have used above is any different than:
> >
> > fq=DateA:[2020-01-01 TO 2030-01-01]
> >
> > The "op=Intersects" parameter that you have included appears to be
> > ignored by the parser code that I examined.
> >
> > If my understanding of the documentation and the code is correct, then
> > you should be able to use this:
> >
> > fq=DateB:[2000-01-01 TO 2020-01-01] OR DateA:[2020-01-01 TO 2030-01-01]
> >
> > In my examples I have changed the URL encoded "+" character back to a
> > regular space.
> >
> > Thanks,
> > Shawn
> >
> >
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Question about multiple fq parameters

Posted by Steven White <sw...@gmail.com>.
Erick, Mikhail, and Shawn, thank you all for your help.



Just a quick re-cap of what I’m trying to achieve: my need is to combine 2
or more “fq” queries to be treated as OR.



Erick, Mikhail, I have the syntax you provided but I cannot get them to
work properly, in fact I’m seeing odd behavior that I cannot explain so I
hope you can shed some light on them.



The following give me hits as expected:



1269 hits:
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateA+v=$a}+{!field+f=DateB+v=$b}+

&a=[2000-01-01+TO+2030-01-01]&b=[2000-01-01+TO+2030-01-01]



1269 hits:
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateA+v=$a}+

&a=[2000-01-01+TO+2030-01-01]



905 hits:
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateB+v=$b}+

&b=[2000-01-01+TO+2030-01-01]



The following don’t give me a hit as expected:



0 hits:
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateA+v=$a}+

&a=[2020-01-01+TO+2030-01-01]



0 hits:
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateB+v=$b}+

&b=[2020-01-01+TO+2030-01-01]



The next 3 syntax are odd behavior that I cannot explain:



A) 1269 hits (expected):
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateA+v=$a}+{!field+f=DateB+v=$b}+

&a=[2000-01-01+TO+2030-01-01]&b=[2020-01-01+TO+2030-01-01]



B) 905 hits (odd result):
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateB+v=$a}+{!field+f=DateA+v=$b}+

&a=[2000-01-01+TO+2030-01-01]&b=[2020-01-01+TO+2030-01-01]



C) 0 hits (but why?!):
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateA+v=$a}+{!field+f=DateB+v=$b}+

&a=[2020-01-01+TO+2030-01-01]&b=[2000-01-01+TO+2030-01-01]



D) 0 hits (but why?!):
http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

{!field+f=DateB+v=$a}+{!field+f=DateA+v=$b}+

&a=[2020-01-01+TO+2030-01-01]&b=[2000-01-01+TO+2030-01-01]



Since my goal here is to have fq apply OR on the two date searches, test B
clearly shows that’s not the case and test C & D shows that fq is ignoring
the second part in the query.



I also tried this syntax:



http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

filter({!field+f=DateA+op=Intersects}[2000-01-01+TO+2020-01-01])+

filter({!field+f=DateB+op=Intersects}[2000-01-01+TO+2030-01-01])



But Solr is reporting an error: “no field name specified in query and no
default specified via 'df' param”.



Shawn, using the syntax that you suggested everything works (including my
mix date range tests of the above):



http://localhost:8983/solr/openpages/select_openpages_3?start=0&q=*&q.op=AND?&q=*&fq=

DateA:[2000-01-01+TO+2030-01-01]+OR+DateB:[2000-01-01 TO 2030-01-01]



My motivation to use “{!field}[]” in fq was what I read somewhere (I cannot
find it now, even after many Google’s on it) is far faster and efficient
than the tradition <Field-Name>:[value]



Steve

On Wed, Jun 8, 2016 at 6:46 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/8/2016 2:28 PM, Steven White wrote:
> > ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>
> Looking at this and checking the code for the Field query parser, I
> cannot see how what you have used above is any different than:
>
> fq=DateA:[2020-01-01 TO 2030-01-01]
>
> The "op=Intersects" parameter that you have included appears to be
> ignored by the parser code that I examined.
>
> If my understanding of the documentation and the code is correct, then
> you should be able to use this:
>
> fq=DateB:[2000-01-01 TO 2020-01-01] OR DateA:[2020-01-01 TO 2030-01-01]
>
> In my examples I have changed the URL encoded "+" character back to a
> regular space.
>
> Thanks,
> Shawn
>
>

Re: Question about multiple fq parameters

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/8/2016 2:28 PM, Steven White wrote:
> ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]

Looking at this and checking the code for the Field query parser, I
cannot see how what you have used above is any different than:

fq=DateA:[2020-01-01 TO 2030-01-01]

The "op=Intersects" parameter that you have included appears to be
ignored by the parser code that I examined.

If my understanding of the documentation and the code is correct, then
you should be able to use this:

fq=DateB:[2000-01-01 TO 2020-01-01] OR DateA:[2020-01-01 TO 2030-01-01]

In my examples I have changed the URL encoded "+" character back to a
regular space.

Thanks,
Shawn


Re: Question about multiple fq parameters

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
What is the meaning of 'op=Intersects' here?



On Thursday, June 9, 2016 12:20 AM, Mikhail Khludnev <mk...@griddynamics.com> wrote:
oh.. hold on. you might need the space in the later one

?&q=*&q.op=OR&fq= {!field+f=DateB+op=Intersects v=$b}
{!field+f=DateA+op=Intersects
v=$a}&b=[2000-01-01+TO+2020-01-01]&a=[2020-01-01+TO+2030-01-01]&...

I don't tell you why


On Thu, Jun 9, 2016 at 12:17 AM, Mikhail Khludnev <
mkhludnev@griddynamics.com> wrote:

>
> ?&q=*&q.op=OR&fq=filter({!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01])
> filter({!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01])&...
>
> or
>
> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects v=$b}
> {!field+f=DateA+op=Intersects
> v=$a}&b=[2000-01-01+TO+2020-01-01]&a=[2020-01-01+TO+2030-01-01]&...
>
>
>
> On Wed, Jun 8, 2016 at 11:46 PM, Steven White <sw...@gmail.com>
> wrote:
>
>> Thanks Mikhail.
>>
>> In that case, how do I force an OR for fq on DateA and DateB?  And to make
>> things more interesting, I will have other fq in my query on different
>> field such as ISBN, or the same field as DateA or DateB that will need to
>> be AND'ed with the query.
>>
>> Steve
>>
>> On Wed, Jun 8, 2016 at 4:31 PM, Mikhail Khludnev <
>> mkhludnev@griddynamics.com
>> > wrote:
>>
>> > C'mon Steve, filters fq=& are always intersected.
>> >
>> > On Wed, Jun 8, 2016 at 11:28 PM, Steven White <sw...@gmail.com>
>> > wrote:
>> >
>> > > Hi everyone,
>> > >
>> > > I cannot make sense of this so I hope someone here can shed some
>> light.
>> > >
>> > > The following gives me 0 hits (expected):
>> > >
>> > >
>> >
>> ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>> > >
>> > > The following gives me hits (expected):
>> > >
>> > >
>> >
>> ?q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]
>> > >
>> > > But the following (combine the above two) gives me 0 hits
>> (unexpected):
>> > >
>> > >
>> > >
>> >
>> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>> > >
>> > > What am I missing?
>> > >
>> > > Thanks.
>> > >
>> > > Steve
>> > >
>> >
>> >
>> >
>> > --
>> > Sincerely yours
>> > Mikhail Khludnev
>> > Principal Engineer,
>> > Grid Dynamics
>> >
>> > <http://www.griddynamics.com>

>> > <mk...@griddynamics.com>
>> >
>>
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Question about multiple fq parameters

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
oh.. hold on. you might need the space in the later one

?&q=*&q.op=OR&fq= {!field+f=DateB+op=Intersects v=$b}
{!field+f=DateA+op=Intersects
v=$a}&b=[2000-01-01+TO+2020-01-01]&a=[2020-01-01+TO+2030-01-01]&...

I don't tell you why


On Thu, Jun 9, 2016 at 12:17 AM, Mikhail Khludnev <
mkhludnev@griddynamics.com> wrote:

>
> ?&q=*&q.op=OR&fq=filter({!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01])
> filter({!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01])&...
>
> or
>
> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects v=$b}
> {!field+f=DateA+op=Intersects
> v=$a}&b=[2000-01-01+TO+2020-01-01]&a=[2020-01-01+TO+2030-01-01]&...
>
>
>
> On Wed, Jun 8, 2016 at 11:46 PM, Steven White <sw...@gmail.com>
> wrote:
>
>> Thanks Mikhail.
>>
>> In that case, how do I force an OR for fq on DateA and DateB?  And to make
>> things more interesting, I will have other fq in my query on different
>> field such as ISBN, or the same field as DateA or DateB that will need to
>> be AND'ed with the query.
>>
>> Steve
>>
>> On Wed, Jun 8, 2016 at 4:31 PM, Mikhail Khludnev <
>> mkhludnev@griddynamics.com
>> > wrote:
>>
>> > C'mon Steve, filters fq=& are always intersected.
>> >
>> > On Wed, Jun 8, 2016 at 11:28 PM, Steven White <sw...@gmail.com>
>> > wrote:
>> >
>> > > Hi everyone,
>> > >
>> > > I cannot make sense of this so I hope someone here can shed some
>> light.
>> > >
>> > > The following gives me 0 hits (expected):
>> > >
>> > >
>> >
>> ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>> > >
>> > > The following gives me hits (expected):
>> > >
>> > >
>> >
>> ?q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]
>> > >
>> > > But the following (combine the above two) gives me 0 hits
>> (unexpected):
>> > >
>> > >
>> > >
>> >
>> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>> > >
>> > > What am I missing?
>> > >
>> > > Thanks.
>> > >
>> > > Steve
>> > >
>> >
>> >
>> >
>> > --
>> > Sincerely yours
>> > Mikhail Khludnev
>> > Principal Engineer,
>> > Grid Dynamics
>> >
>> > <http://www.griddynamics.com>
>> > <mk...@griddynamics.com>
>> >
>>
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Question about multiple fq parameters

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
?&q=*&q.op=OR&fq=filter({!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01])
filter({!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01])&...

or

?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects v=$b}
{!field+f=DateA+op=Intersects
v=$a}&b=[2000-01-01+TO+2020-01-01]&a=[2020-01-01+TO+2030-01-01]&...



On Wed, Jun 8, 2016 at 11:46 PM, Steven White <sw...@gmail.com> wrote:

> Thanks Mikhail.
>
> In that case, how do I force an OR for fq on DateA and DateB?  And to make
> things more interesting, I will have other fq in my query on different
> field such as ISBN, or the same field as DateA or DateB that will need to
> be AND'ed with the query.
>
> Steve
>
> On Wed, Jun 8, 2016 at 4:31 PM, Mikhail Khludnev <
> mkhludnev@griddynamics.com
> > wrote:
>
> > C'mon Steve, filters fq=& are always intersected.
> >
> > On Wed, Jun 8, 2016 at 11:28 PM, Steven White <sw...@gmail.com>
> > wrote:
> >
> > > Hi everyone,
> > >
> > > I cannot make sense of this so I hope someone here can shed some light.
> > >
> > > The following gives me 0 hits (expected):
> > >
> > >
> >  ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
> > >
> > > The following gives me hits (expected):
> > >
> > >
> >  ?q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]
> > >
> > > But the following (combine the above two) gives me 0 hits (unexpected):
> > >
> > >
> > >
> >
> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
> > >
> > > What am I missing?
> > >
> > > Thanks.
> > >
> > > Steve
> > >
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > Principal Engineer,
> > Grid Dynamics
> >
> > <http://www.griddynamics.com>
> > <mk...@griddynamics.com>
> >
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Question about multiple fq parameters

Posted by Erick Erickson <er...@gmail.com>.
Put the whole thing in a single clause, i.e.
fq=A OR B.

bq: I will have other fq in my query on different
field such as ISBN, or the same field as DateA or DateB that will need to
be AND'ed with the query

This is what Mikhail was telling you. Something like
q=A AND B AND C AND D
should give the same results as
q=*:*&fq=A&fq=B&fq=C&fq=D
or
q=A&fq=B&fq=C&fq=D
etc.

Best,
Erick

On Wed, Jun 8, 2016 at 1:46 PM, Steven White <sw...@gmail.com> wrote:
> Thanks Mikhail.
>
> In that case, how do I force an OR for fq on DateA and DateB?  And to make
> things more interesting, I will have other fq in my query on different
> field such as ISBN, or the same field as DateA or DateB that will need to
> be AND'ed with the query.
>
> Steve
>
> On Wed, Jun 8, 2016 at 4:31 PM, Mikhail Khludnev <mkhludnev@griddynamics.com
>> wrote:
>
>> C'mon Steve, filters fq=& are always intersected.
>>
>> On Wed, Jun 8, 2016 at 11:28 PM, Steven White <sw...@gmail.com>
>> wrote:
>>
>> > Hi everyone,
>> >
>> > I cannot make sense of this so I hope someone here can shed some light.
>> >
>> > The following gives me 0 hits (expected):
>> >
>> >
>>  ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>> >
>> > The following gives me hits (expected):
>> >
>> >
>>  ?q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]
>> >
>> > But the following (combine the above two) gives me 0 hits (unexpected):
>> >
>> >
>> >
>> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>> >
>> > What am I missing?
>> >
>> > Thanks.
>> >
>> > Steve
>> >
>>
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>> Principal Engineer,
>> Grid Dynamics
>>
>> <http://www.griddynamics.com>
>> <mk...@griddynamics.com>
>>

Re: Question about multiple fq parameters

Posted by Steven White <sw...@gmail.com>.
Thanks Mikhail.

In that case, how do I force an OR for fq on DateA and DateB?  And to make
things more interesting, I will have other fq in my query on different
field such as ISBN, or the same field as DateA or DateB that will need to
be AND'ed with the query.

Steve

On Wed, Jun 8, 2016 at 4:31 PM, Mikhail Khludnev <mkhludnev@griddynamics.com
> wrote:

> C'mon Steve, filters fq=& are always intersected.
>
> On Wed, Jun 8, 2016 at 11:28 PM, Steven White <sw...@gmail.com>
> wrote:
>
> > Hi everyone,
> >
> > I cannot make sense of this so I hope someone here can shed some light.
> >
> > The following gives me 0 hits (expected):
> >
> >
>  ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
> >
> > The following gives me hits (expected):
> >
> >
>  ?q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]
> >
> > But the following (combine the above two) gives me 0 hits (unexpected):
> >
> >
> >
> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
> >
> > What am I missing?
> >
> > Thanks.
> >
> > Steve
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
>

Re: Question about multiple fq parameters

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
C'mon Steve, filters fq=& are always intersected.

On Wed, Jun 8, 2016 at 11:28 PM, Steven White <sw...@gmail.com> wrote:

> Hi everyone,
>
> I cannot make sense of this so I hope someone here can shed some light.
>
> The following gives me 0 hits (expected):
>
>   ?q=*&q.op=OR&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>
> The following gives me hits (expected):
>
>   ?q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]
>
> But the following (combine the above two) gives me 0 hits (unexpected):
>
>
> ?&q=*&q.op=OR&fq={!field+f=DateB+op=Intersects}[2000-01-01+TO+2020-01-01]&fq={!field+f=DateA+op=Intersects}[2020-01-01+TO+2030-01-01]
>
> What am I missing?
>
> Thanks.
>
> Steve
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>