Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm looking into a solution for a querry web part(?) The web part should display the 10 last updated documents (or less), in the last 2 weeks for all the document libraries in a specific web application for which the currently logged in user has access (Security trimmed results) (+/- 150 doc libs)

In order to achieve the security trimmed results I suppose a combination with the search service should be applied.

What would be the best approach or best practices to develop this? (Maybe SP2010 has some standard web parts / features to achieve this?)

Thanks in advance!

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Yes, using the search service is going to be the most efficient way for a cross site collection query.

Use the SQL syntax:

http://msdn.microsoft.com/en-us/library/ms497585.aspx

With the order by as modified desc, and just grab the first ten records using row limit on the query object

Set your incremental crawl to be semi fast (under an hour)

Pass those search results into your web part, and display either using xslt or build a control tree.

share|improve this answer
    
Thanks Djeeg, I don't know if you can help with some examples? On how to format the data I get back from FullTextSqlQuery sqlQuery = new FullTextSqlQuery(SPContext.Current.Site); ResultTableCollection resultTables = sqlQuery.Execute(); –  Wim Hill Feb 24 '11 at 14:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.