Lucene.Net.Search.BooleanQuery+TooManyClauses: maxClauseCount is set to 1024

295 views
Skip to first unread message

Gonkers

unread,
Feb 20, 2015, 5:29:25 PM2/20/15
to rav...@googlegroups.com
I'm getting the following error and I know the cause but I'm trying to design a workaround and need some suggestions...

Lucene.Net.Search.BooleanQuery+TooManyClauses: maxClauseCount is set to 1024


Basically I have a Report object, with, lets call it a group ID. I also have a user object with a collection of group IDs he or she has access to.

public class User
{
    public int Id;
    public List<int> GroupAccessList;
    ...
}
 
public class Report
{
    public int Id;
    public int GroupId;
    public string DataItem1;
    ...
}

For reference Many users can belong to Many groups, users are not directly tied to Reports.  I have many thousands of reports that make up thousands of groups. There are some users that have access to thousands of groups therefore many thousands of reports.

In most cases a query like this works fine...
session.Query<Report>().Where(r => r.GroupId.In(User.GroupAccessList));

When the user has access to over 1024 groups, the query fails. I really want a query where I pass just a UserId and get back a list of reports. Passing a list of more than 20 IDs, little lone 2000, is just ugly and is too much data over the wire.

Any help would be appreciated,

Thanks!

Oren Eini (Ayende Rahien)

unread,
Feb 22, 2015, 2:35:15 AM2/22/15
to ravendb
What build are you using?


Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gonkers

unread,
Feb 23, 2015, 8:13:24 AM2/23/15
to rav...@googlegroups.com
I'm currently using build Server Build #3528

Gonkers

unread,
Feb 23, 2015, 8:22:28 AM2/23/15
to rav...@googlegroups.com
To help further explain what I'm trying to do it would be the same as this SQL query...
SELECT r.*
FROM user_group ug
INNER JOIN report r ON ug.GroupID = r.GroupID
WHERE ug.UserID = 1234

Oren Eini (Ayende Rahien)

unread,
Feb 23, 2015, 8:26:09 AM2/23/15
to ravendb
That shouldn't be the case. Can you send a way to reproduce this?

Gonkers

unread,
Feb 23, 2015, 9:06:54 AM2/23/15
to rav...@googlegroups.com
Here is what i'm doing...

    return session.Query<ReportModel>()
        .Where(r => r.GroupId.In(groupIDList))
        .Where(r => r.CreatedAt >= beginDateTime && r.CreatedAt <= endDateTime)
        .Where(r => r.RequiresReview == queryRequiresReview)
        .OrderBy(r => r.Status)
        .ThenByDescending(r => r.CreatedAt)
        .Skip(recordsToSkip)
        .Take(recordsToTake)

the groupIDList is a List<int> with 2800 entries... when that is at 1023 or less, it seems to work fine.

Oren Eini (Ayende Rahien)

unread,
Feb 23, 2015, 9:13:40 AM2/23/15
to ravendb
This works for me:

var list = Enumerable.Range(0, 2050).Select(x => x.ToString()).ToList();

var empOfMon = session.Query<EmployeeOfTheMonth.Result, EmployeeOfTheMonth>()
.Where(x => x.Month.In(list))
.Where(x=>x.Employee == "Foo")
.FirstOrDefault();


Please send a full failing test.
Reply all
Reply to author
Forward
0 new messages