Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# D3grade 1/5/2008 2:12 PM
Hi Guys,

We have used cuyahoga on a project for a client with offices worldwide. We make use of cuyahogas site feature to allow each office to have it's own site. So we now have cuyahoga maintaining 9 sites and a total of nearly 2000 pages.

We have recently hit a problem with the search feature and am not sure what to do to resolve it. Whenever we try to do a search we get the following exception:
Server Error in '/' Application.
--------------------------------------------------------------------------------

System error. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Lucene.Net.Search.BooleanQuery+TooManyClauses: System error.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[TooManyClauses: System error.]
   Lucene.Net.Search.BooleanQuery.Add(BooleanClause clause) +60
   Lucene.Net.Search.BooleanQuery.Add(Query query, Occur occur) +59
   THINK.Core.Service.Search.IndexQuery.BuildSecurityQuery(IList`1 sectionIds, IList`1 userRoleIds) in D:\Work\THINK\CMS_DEV02\Source\Core\Service\Search\IndexQuery.cs:132
   THINK.Core.Service.Search.IndexQuery.Find(String queryText, IDictionary`2 keywordFilter, IList`1 categoryNames, Int32 pageIndex, Int32 pageSize, IList`1 sectionIds, IList`1 userRoleIds) in D:\Work\THINK\CMS_DEV02\Source\Core\Service\Search\IndexQuery.cs:52
   THINK.Core.Service.Search.SearchService.FindContent(String queryText, IDictionary`2 keywordFilter, IList`1 categoryNames, Int32 pageIndex, Int32 pageSize, User user) in D:\Work\THINK\CMS_DEV02\Source\Core\Service\Search\SearchService.cs:186
   THINK.Core.Service.Search.SearchService.FindContent(String queryText, IDictionary`2 keywordFilter, Int32 pageIndex, Int32 pageSize, User user) in D:\Work\THINK\CMS_DEV02\Source\Core\Service\Search\SearchService.cs:156
   THINK.Modules.Search.SearchModule.GetSearchResults(String queryText, Int32 pageIndex, Int32 pageSize, User user) +261
   THINK.Modules.Search.SearchModule.GetSearchResults(String queryText, User user) +45
   THINK.Modules.Search.Search.BindSearchResults(String queryString, Int32 pageIndex) +152
   THINK.Modules.Search.Search.Page_Load(Object sender, EventArgs e) +312
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 

This is whats lucene say about the exception
Thrown when an attempt is made to add more than {@link #GetMaxClauseCount()} clauses. This typically happens if a PrefixQuery, FuzzyQuery, WildcardQuery, or RangeQuery is expanded to many terms during search.

Can anybody offer some advice on how to fix this?

Many thanks

Matt
# D3grade 1/5/2008 2:18 PM
PS The amount of content will potentialy become enormous as these sites currently only have english content, which at a later date will be translated into 6 different languages.

Gulp!!!
# D3grade 1/7/2008 12:56 PM
Ok well i've had to implement my own fix for now as i'm having this problem on a live site, but my fix still has the potential to thow this error.

This issue occurs within the BuildSecurityQuery in the IndexQuery class. As i mentioned before, the site has a large amount of content, and the issue was caused because there were over 2000 sections to search against.

My fix for now is to alter the GetViewableSectionsByAccessLevel and GetViewableSectionsByUser methods in the user dao to filter by site and culture so as to limit the list of sections the query has to search against.

This isn't an ideal solution though as it is still possible to reach the maximum limit if the site had over 1024 sections.
# martijnb 1/7/2008 4:11 PM
Allright, glad you found this, because I really had no idea. I'll create a Jira issue to make sure we don't forget about this. Thanks.