CAML queries: how to filter folders from result set?

后端 未结 8 1623
遇见更好的自我
遇见更好的自我 2021-02-12 11:38

I\'m using caml query to select all documents which were modified or added by user. Query runs recursively on all subsites of specified site collection.

Now problem is I

8条回答
  •  孤城傲影
    2021-02-12 11:59

    Dave T.'s answer didn't work for me but taking it as an inspiration here's what I came up with:

    
      
        0x0101
      
    
    

    The main problem is that we can only know ContentTypeId on a site level, because when a content type gets added to a list/library it becomes a list content type and its ID is appended with another GUID (0x010100...). And there's no NotBeginsWith condition in CAML, so we can not filter out folders, but we can include documents only which site content type id is 0x0101.

    The solutions with FSObjType field don't work for me because I have libraries with far more files than a threshold so all the fields in the query must be indexed and I haven't found a way to index this field.

提交回复
热议问题