Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bobi 352 posts 956 karma points
    Mar 12, 2017 @ 02:09
    Bobi
    0

    Search error re maxClauseCount is set to 1024

    I am receiving the following error with ezsearch when the search query is more than one term.:

    maxClauseCount is set to 1024 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: maxClauseCount is set to 1024

    Source Error:

    Line 111: }

    Line 112:

    Line 113: var criteria2 = criteria.RawQuery(query.ToString());

    Line 114:

    Line 115: var results = searcher.Search(criteria2)

    Any ideas as to how to fix this?

  • Justyna 14 posts 146 karma points
    Jun 14, 2017 @ 08:17
    Justyna
    0

    Hi Bobi, have you ever managed to solve your issue? I'm having the same problem.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jun 14, 2017 @ 08:34
    Ismail Mayat
    1

    Guys,

    This is lucene set limit. How big is your search term? Bit more information about it here https://stackoverflow.com/questions/1534789/help-needed-figuring-out-reason-for-maxclausecount-is-set-to-1024-error

  • Bobi 352 posts 956 karma points
    Jun 14, 2017 @ 14:17
    Bobi
    0

    Hi Justyna,

    I did manage to solve the issue by renaming a lot of my property aliases to generic names, rather than specific ones. As such, calling the property aliases in ezSearch was less cumbersome, since there were less specific property aliases to search, and thus no more maxclause issues.

    Eg: instead of pAlias1, pAlias2, and pAlias3, I would give all of those pAlias (if they were generally related in some way). I would then call pAlias instead of the specific aforementioned ones.

    Hope this helps.

  • Ahmed Ramadan 10 posts 100 karma points
    Mar 12, 2019 @ 21:27
    Ahmed Ramadan
    0

    add this code

    @using Lucene.Net.Search;
    @BooleanQuery.SetMaxClauseCount(2048);
    
Please Sign in or register to post replies

Write your reply to:

Draft