Skip to main content

Search

Troubles with CAML list query with lists >5.000 entries (threshold exceedance)

Comments

4 comments

  • Christof

    Hi Christoph
    Had the same effect when querying my large list (>5k items) with just a single "Any" group.
    In my case it did help to add just an additional "Any" group comparison with the FileRef against a not valid dummy URL - don't ask me why exactly this filter is helping...

    Reordering that the first filter comparison is returning not more than 5k items did help in most cases too + indexing the columns used in the filter (in some cases it's needed to not-index some columns - can't explain which specific cases...).

    Hope this helps to solve your problem

    0
  • Christoph Käferböck

    Hi Christof,

    I have tried your idea. Unfortunately it doesn't work. It always returns zero items, i guess at there is no single item with FileRef = /sites/dummyURL.

     

     

    0
  • Christof

    Hi Christoph
    For sure there is no item in the target list matching this imaginary FileRef value... it's just an additional filter part acting as workaround.
    But now you're mentioning that you get back zero items and not facing the list view threshold error anymore, correct? Then the query to the list works without list view threshold issue and seems just your filter doesn't match with any items. 

    0
  • Christoph Käferböck

    It just works like this:

    Then there is not threshold issue anymore but also no found item.

    When I change the filter to this (according to your example), it doesn't work anymore (threshold issue back again):

    0

Please sign in to leave a comment.