You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Shane Strasser <sh...@gmail.com> on 2013/08/01 22:33:33 UTC

Join Util with Filter Queries

Hey All,

We're currently looking into using the Join Utility  (we're on version 4.0
and are in the process of moving to 4.3) and have started to prototype some
of the tools. One thing we'll need to be able to do is add filter queries.
The question I have is that based on the documentation it almost sounds
like the filters will be processed pre join. However, I'm observing that
the filters are getting applied post joining. Is this supposed to be the
case? If so, what would be the best way to modify the source so that
queries are applied pre join and not post join? Thanks.

-Shane

Re: Join Util with Filter Queries

Posted by Martijn v Groningen <ma...@gmail.com>.
Maybe you can just get the `fq` parameter from the `params` parameter in
the createParse method and then use that to create the a FilteredQuery
yourself and use that as the fromQuery?


On 6 August 2013 22:53, Shane Strasser <sh...@gmail.com> wrote:

> So after looking into the problem, I've started to narrow it down a little
> more. To answer your question, there were two reasons why it looked like
> the filters were getting applied post join:
>
> 1) On my test cases that I've created, the correct documents were not
> getting returned
> to be me (I can supply the test file if you're curious).
> 2) When debugging my query, the fromQuery parameter only contains the query
> string (q="") and none of the Filtered Query parameters. I'm using this
> suggestion as a guide to build my query parser
> https://issues.apache.org/jira/browse/LUCENE-4043 (creating my own
> QParserPlugin and having that call the Join Utility class). When looking at
> the query that gets passed into the join query, it is missing the filter
> queries parameters. Those are getting stored somewhere and then are being
> used post join. It's looking like that my problem isn't so much with the
> join utility, but more with my query parser plugging class. Is there
> something that it missing in the above link example that I need to also add
> to mine to ensure that queries are applied pre join? Thanks.
>
> -Shane
>
>
>
> On Fri, Aug 2, 2013 at 10:46 AM, Martijn v Groningen <
> martijn.v.groningen@gmail.com> wrote:
>
> > Hi,
> >
> > If you specify the FilteredQuery via the 'fromQuery' parameter, then they
> > should be executed before the the join operation is performed.
> > What makes you think that the FilteredQuery is applied post join?
> >
> > Martijn
> >
> >
> > On 1 August 2013 22:33, Shane Strasser <sh...@gmail.com> wrote:
> >
> > > Hey All,
> > >
> > > We're currently looking into using the Join Utility  (we're on version
> > 4.0
> > > and are in the process of moving to 4.3) and have started to prototype
> > some
> > > of the tools. One thing we'll need to be able to do is add filter
> > queries.
> > > The question I have is that based on the documentation it almost sounds
> > > like the filters will be processed pre join. However, I'm observing
> that
> > > the filters are getting applied post joining. Is this supposed to be
> the
> > > case? If so, what would be the best way to modify the source so that
> > > queries are applied pre join and not post join? Thanks.
> > >
> > > -Shane
> > >
> >
> >
> >
> > --
> > Met vriendelijke groet,
> >
> > Martijn van Groningen
> >
>



-- 
Met vriendelijke groet,

Martijn van Groningen

Re: Join Util with Filter Queries

Posted by Shane Strasser <sh...@gmail.com>.
So after looking into the problem, I've started to narrow it down a little
more. To answer your question, there were two reasons why it looked like
the filters were getting applied post join:

1) On my test cases that I've created, the correct documents were not
getting returned
to be me (I can supply the test file if you're curious).
2) When debugging my query, the fromQuery parameter only contains the query
string (q="") and none of the Filtered Query parameters. I'm using this
suggestion as a guide to build my query parser
https://issues.apache.org/jira/browse/LUCENE-4043 (creating my own
QParserPlugin and having that call the Join Utility class). When looking at
the query that gets passed into the join query, it is missing the filter
queries parameters. Those are getting stored somewhere and then are being
used post join. It's looking like that my problem isn't so much with the
join utility, but more with my query parser plugging class. Is there
something that it missing in the above link example that I need to also add
to mine to ensure that queries are applied pre join? Thanks.

-Shane



On Fri, Aug 2, 2013 at 10:46 AM, Martijn v Groningen <
martijn.v.groningen@gmail.com> wrote:

> Hi,
>
> If you specify the FilteredQuery via the 'fromQuery' parameter, then they
> should be executed before the the join operation is performed.
> What makes you think that the FilteredQuery is applied post join?
>
> Martijn
>
>
> On 1 August 2013 22:33, Shane Strasser <sh...@gmail.com> wrote:
>
> > Hey All,
> >
> > We're currently looking into using the Join Utility  (we're on version
> 4.0
> > and are in the process of moving to 4.3) and have started to prototype
> some
> > of the tools. One thing we'll need to be able to do is add filter
> queries.
> > The question I have is that based on the documentation it almost sounds
> > like the filters will be processed pre join. However, I'm observing that
> > the filters are getting applied post joining. Is this supposed to be the
> > case? If so, what would be the best way to modify the source so that
> > queries are applied pre join and not post join? Thanks.
> >
> > -Shane
> >
>
>
>
> --
> Met vriendelijke groet,
>
> Martijn van Groningen
>

Re: Join Util with Filter Queries

Posted by Martijn v Groningen <ma...@gmail.com>.
Hi,

If you specify the FilteredQuery via the 'fromQuery' parameter, then they
should be executed before the the join operation is performed.
What makes you think that the FilteredQuery is applied post join?

Martijn


On 1 August 2013 22:33, Shane Strasser <sh...@gmail.com> wrote:

> Hey All,
>
> We're currently looking into using the Join Utility  (we're on version 4.0
> and are in the process of moving to 4.3) and have started to prototype some
> of the tools. One thing we'll need to be able to do is add filter queries.
> The question I have is that based on the documentation it almost sounds
> like the filters will be processed pre join. However, I'm observing that
> the filters are getting applied post joining. Is this supposed to be the
> case? If so, what would be the best way to modify the source so that
> queries are applied pre join and not post join? Thanks.
>
> -Shane
>



-- 
Met vriendelijke groet,

Martijn van Groningen