Microsoft
70-573 · Question #34
You need to create a Web Part that displays all content created by a specific user. You write the following code segment. (Line numbers are included for reference only.) 01 privace void…
The correct answer is B. string strQuery = "author:" + searchAuthor. MNEMONIC RULE: "KeywordQuery =no SQL!" Property Restriction Keyword Queries
Developing for Data Access
Question
You need to create a Web Part that displays all content created by a specific user. You write the following code segment. (Line numbers are included for reference only.) 01 privace void keywordQueryExecute (string searchAuthor ) 02 { 03 KeywordQuery kRequest = new KeywordQuery ( ServerContexc.Current ) ; 04 05 kPequest.QueryText = strQuery ; 06 ResultTableCollection resultTbls = kRequest.Execute () ; 07 } Which code segment should you add at line 04?
Options
- Astring strQuery - "SELECT Title, Rank, Write, Url FROM SCOPE()
- Bstring strQuery = "author:" + searchAuthor;
- Cstring strQuery = "SELECT Title, Rank, Write, Url FROM SCOPE ()
- Dstring strQuery * " doc ID:" + searchAuthor ;
How the community answered
(45 responses)- A7% (3)
- B80% (36)
- C2% (1)
- D11% (5)
Explanation
MNEMONIC RULE: "KeywordQuery =no SQL!" Property Restriction Keyword Queries
Topics
#KeywordQuery#search syntax#author filter#full-text search
Community Discussion
No community discussion yet for this question.