Question

I'm using a KeywordQuery within a custom Webpart on a SP2010 farm to aggregate the latest "documents" from the site collection the webpart is running at ("document" = every item stored in a document library except the folders).

Within the QueryString I limit the results to contentclass:STS_ListItem_DocumentLibrary, but folders are still present in the search results.

I’ve tried using IsDocument:1 but then the results are too limited, because there are some file types not registered in the Search Service Application file type pool, e.g. "RTF", "RAR", "PNG", ...

Do I really have to register every file type within the SSA to expand IsDocument or are there other ways to exclude the folders from the results?

Was it helpful?

Solution

To exclude the Folders try adding "Size>0" to your query and see if that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top