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

Is there a way of making the Fixed Keyword Query in search core web part to get the current user login (Author:{CurrentUser}).

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

I wish there was a builtin way to do that, but there is not. You will need to write a custom Web Part which inherits from CoreResultsWebPart. You can then use the QueryManager object to change the value of the query.

share|improve this answer
    
Good answer, although there doesn't seem to be a QueryManager object in CoreResultsWebPart. Overwriting the FixedQuery property will do it. –  Jasper Jul 11 '12 at 8:11
    
Update (struggling with it myself): there is a SharedQueryManager.GetInstance property which let's you retrieve a SharedQueryManager object. That one has a QueryManager object to influence the query. –  Jasper Jul 11 '12 at 11:38
add comment

You can use fixed keyword query in core search results web part. Just modify the web part and enter your query in the relevant property.

share|improve this answer
    
That wasn't the question, the question was if he could add something like [Me] or Current User to the fixed field, which can't be done apparantly. –  Jasper Jul 10 '12 at 15:30
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.