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 Stefan Matheis <ma...@googlemail.com> on 2011/01/17 13:57:37 UTC

FilterQuery reaching maxBooleanClauses, alternatives?

Hi List,

we are sometimes reaching the maxBooleanClauses Limit (which is 1024, per
default). So, the used query looks like:

?q=name:Stefan&fq=5 10 12 15 16 [...]

where the values are ids of users, which the current user is allowed to see
- so long, nothing special. sometimes the filter-query includes user-ids
from an different Type of User (let's say we have TypeA and TypeB) where
TypeB contains more then 2k users. Then we hit the given Limit.

Now the Question is .. is it possible to enable an Filter/Function/Feature
in Solr, which it makes possible, that we don't need to send over alle the
user ids from TypeB Users? Just to tell Solr "include all TypeB Users in the
(given) FilterQuery" (or something in that direction)?

If so, what's the Name of this Filter/Function/Feature? :)

Don't hesitate to ask, if my question/description is weird!

Thanks
Stefan

Re: FilterQuery reaching maxBooleanClauses, alternatives?

Posted by Salman Akram <sa...@northbaysolutions.net>.
You are welcome.

By new field I meant if you don't have a field for UserType already.

On Mon, Jan 17, 2011 at 6:22 PM, Stefan Matheis <
matheis.stefan@googlemail.com> wrote:

> Thanks Salman,
>
> talking with others about problems really helps. Adding another FilterQuery
> is a bit too much - but combining both is working fine!
>
> not seen the wood for the trees =)
> Thanks, Stefan
>
>
> On Mon, Jan 17, 2011 at 2:07 PM, Salman Akram <
> salman.akram@northbaysolutions.net> wrote:
>
> > You can index a field which can the User types e.g. UserType (possible
> > values can be TypeA,TypeB and so on...) and then you can just do
> >
> > ?q=name:Stefan&fq=UserType:TypeB
> >
> > BTW you can even increase the size of maxBooleanClauses but in this case
> > definitely this is not a good idea. Also you would hit the max limit of
> > HTTP
> > GET so you will have to change it to POST. Better handle it with a new
> > field.
> >
> > On Mon, Jan 17, 2011 at 5:57 PM, Stefan Matheis <
> > matheis.stefan@googlemail.com> wrote:
> >
> > > Hi List,
> > >
> > > we are sometimes reaching the maxBooleanClauses Limit (which is 1024,
> per
> > > default). So, the used query looks like:
> > >
> > > ?q=name:Stefan&fq=5 10 12 15 16 [...]
> > >
> > > where the values are ids of users, which the current user is allowed to
> > see
> > > - so long, nothing special. sometimes the filter-query includes
> user-ids
> > > from an different Type of User (let's say we have TypeA and TypeB)
> where
> > > TypeB contains more then 2k users. Then we hit the given Limit.
> > >
> > > Now the Question is .. is it possible to enable an
> > Filter/Function/Feature
> > > in Solr, which it makes possible, that we don't need to send over alle
> > the
> > > user ids from TypeB Users? Just to tell Solr "include all TypeB Users
> in
> > > the
> > > (given) FilterQuery" (or something in that direction)?
> > >
> > > If so, what's the Name of this Filter/Function/Feature? :)
> > >
> > > Don't hesitate to ask, if my question/description is weird!
> > >
> > > Thanks
> > > Stefan
> > >
> >
> >
> >
> > --
> > Regards,
> >
> > Salman Akram
> >
>



-- 
Regards,

Salman Akram

Re: FilterQuery reaching maxBooleanClauses, alternatives?

Posted by Stefan Matheis <ma...@googlemail.com>.
Thanks Salman,

talking with others about problems really helps. Adding another FilterQuery
is a bit too much - but combining both is working fine!

not seen the wood for the trees =)
Thanks, Stefan


On Mon, Jan 17, 2011 at 2:07 PM, Salman Akram <
salman.akram@northbaysolutions.net> wrote:

> You can index a field which can the User types e.g. UserType (possible
> values can be TypeA,TypeB and so on...) and then you can just do
>
> ?q=name:Stefan&fq=UserType:TypeB
>
> BTW you can even increase the size of maxBooleanClauses but in this case
> definitely this is not a good idea. Also you would hit the max limit of
> HTTP
> GET so you will have to change it to POST. Better handle it with a new
> field.
>
> On Mon, Jan 17, 2011 at 5:57 PM, Stefan Matheis <
> matheis.stefan@googlemail.com> wrote:
>
> > Hi List,
> >
> > we are sometimes reaching the maxBooleanClauses Limit (which is 1024, per
> > default). So, the used query looks like:
> >
> > ?q=name:Stefan&fq=5 10 12 15 16 [...]
> >
> > where the values are ids of users, which the current user is allowed to
> see
> > - so long, nothing special. sometimes the filter-query includes user-ids
> > from an different Type of User (let's say we have TypeA and TypeB) where
> > TypeB contains more then 2k users. Then we hit the given Limit.
> >
> > Now the Question is .. is it possible to enable an
> Filter/Function/Feature
> > in Solr, which it makes possible, that we don't need to send over alle
> the
> > user ids from TypeB Users? Just to tell Solr "include all TypeB Users in
> > the
> > (given) FilterQuery" (or something in that direction)?
> >
> > If so, what's the Name of this Filter/Function/Feature? :)
> >
> > Don't hesitate to ask, if my question/description is weird!
> >
> > Thanks
> > Stefan
> >
>
>
>
> --
> Regards,
>
> Salman Akram
>

Re: FilterQuery reaching maxBooleanClauses, alternatives?

Posted by Salman Akram <sa...@northbaysolutions.net>.
You can index a field which can the User types e.g. UserType (possible
values can be TypeA,TypeB and so on...) and then you can just do

?q=name:Stefan&fq=UserType:TypeB

BTW you can even increase the size of maxBooleanClauses but in this case
definitely this is not a good idea. Also you would hit the max limit of HTTP
GET so you will have to change it to POST. Better handle it with a new
field.

On Mon, Jan 17, 2011 at 5:57 PM, Stefan Matheis <
matheis.stefan@googlemail.com> wrote:

> Hi List,
>
> we are sometimes reaching the maxBooleanClauses Limit (which is 1024, per
> default). So, the used query looks like:
>
> ?q=name:Stefan&fq=5 10 12 15 16 [...]
>
> where the values are ids of users, which the current user is allowed to see
> - so long, nothing special. sometimes the filter-query includes user-ids
> from an different Type of User (let's say we have TypeA and TypeB) where
> TypeB contains more then 2k users. Then we hit the given Limit.
>
> Now the Question is .. is it possible to enable an Filter/Function/Feature
> in Solr, which it makes possible, that we don't need to send over alle the
> user ids from TypeB Users? Just to tell Solr "include all TypeB Users in
> the
> (given) FilterQuery" (or something in that direction)?
>
> If so, what's the Name of this Filter/Function/Feature? :)
>
> Don't hesitate to ask, if my question/description is weird!
>
> Thanks
> Stefan
>



-- 
Regards,

Salman Akram