Which code segment should you use?

You are creating a Microsoft Office SharePoint Server 2007 application that uses the Search service. You need to ensure that the search results are based on an existing keyword.

Which code segment should you use?

You are creating a Microsoft Office SharePoint Server 2007 application that uses the Search service. You need to ensure that the search results are based on an existing keyword.

Which code segment should you use?

A.
private void keywordQueryExecute(string strQueryText) {

KeywordQuery kRequest =
new KeywordQuery(ServerContext.Current);
kRequest.QueryText = strQueryText;
kRequest.ResultTypes |= ResultType.RelevantResults;
ResultTableCollection resultTbls = kRequest.Execute();

}

B.
private void keywordQueryExecute(string strQueryText) {

KeywordQuery kRequest =
new KeywordQuery(ServerContext.Current);
kRequest.QueryText =
“SELECT * FROM scope() WHERE keyword = ” + strQueryText;
kRequest.ResultTypes |= ResultType.RelevantResults;
ResultTableCollection resultTbls = kRequest.Execute();

}

C.
private void keywordQueryExecute(string strQueryText) {

KeywordQuery kRequest =
new KeywordQuery(ServerContext.Current);
kRequest.QueryText =
“SELECT * FROM scope(” + strQueryText + “)”;
kRequest.ResultTypes |= ResultType.RelevantResults;
ResultTableCollection resultTbls = kRequest.Execute();

}

D.
private void keywordQueryExecute(string strQueryText) {

KeywordQuery kRequest =
new KeywordQuery(ServerContext.Current);
kRequest.QueryText =
“SELECT ” + strQueryText + ” FROM scope()”;
kRequest.ResultTypes |= ResultType.RelevantResults;
ResultTableCollection resultTbls = kRequest.Execute();

}



Leave a Reply 0

Your email address will not be published. Required fields are marked *