nerdexam
Microsoft

70-573 · Question #275

You need to create a Web Part that displays all of the content created by a specific user. You write the following code segment. (Line numbers are included for reference only.) 01 private void…

The correct answer is A. 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 of the content created by a specific user. You write the following code segment. (Line numbers are included for reference only.) 01 private void keywordQueryExecute(string searchAuthor) 02 { 03 KeywordQuery kRequest = new KeywordQuery(ServerContext.Current); 04 05 kRequest.QueryText = strQuery; 06 ResultTableCollection resultTbls = kRequest.Execute(); 07 } Which code segment should you add at line 04?

Options

  • Astring strQuery = "author:" + searchAuthor;
  • Bstring strQuery = "docID:" + searchAuthor;
  • Cstring strQuery = "SELECT Title, Rank, Write, Url FROM SCOPE()
  • Dstring strQuery = "SELECT Title, Rank, Write, Url FROM SCOPE()

How the community answered

(30 responses)
  • A
    77% (23)
  • B
    3% (1)
  • C
    13% (4)
  • D
    7% (2)

Explanation

MNEMONIC RULE: "KeywordQuery = no SQL!" Property Restriction Keyword Queries

Topics

#KeywordQuery#search API#author property#keyword query syntax

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice