I want to get all pages from pages library from search result where page layout name is "abc.aspx". I have tried below code but it is not working. If I simply pass "abc" in querytext then it will get result from list,library and from every where. I want to get only those pages whose page layout is "abc.aspx". How to do that?
string pageLayoutFullName="abc.aspx"
KeywordQuery keywordQueryTop = new KeywordQuery(site);
keywordQueryTop.SelectProperties.Add("Title");
keywordQueryTop.SelectProperties.Add("PublishingPageLayoutOWSURLH");
keywordQueryTop.SelectProperties.Add("WebId");
keywordQueryTop.SelectProperties.Add("ModifiedOWSDATE");
keywordQueryTop.RowLimit = 15;
keywordQueryTop.ResultsProvider = SearchProvider.SharepointSearch;
keywordQueryTop.QueryText = String.Format("PublishingPageLayoutOWSURLH=\"*{0}\"", pageLayoutFullName);
*omething
), only prefix-matching (somethin*
). Try to add the full URL to the page layout, or look for another managed property containing only for examle the name of the layouthttp://portal.com/_catalogs/masterpage/PageLayoutFileName.aspx, PageLayoutName
. If not, it seems more difficult!