2

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

2

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.

2
  • 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
0

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.

1
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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