November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hello, After having a look, the query would look something like this:
internal Injected<IClient> FindClientService { get; set; }
var sitePages = FindClientService.Service.Search<PageData>() .Filter(page => page.ParentLink.Match(parentReference)) .Filter(page => page.Name.PrefixCaseInsensitive("A") | page.Name.PrefixCaseInsensitive("b")) .OrderBy(page => page.Name) .GetContentResult();
You would send the reference for the parent page into the query and then you could then put the characters into the 2nd filter method in the PrefixCaseInsensitive method. The above example would return pages that are children of a specific page. The second filter would then return if any of the pages Name begins with A or B (no matter if they are uppercase or lowercase).
Hope this helps!
Ok, I get what you mean now. I shall have to have a look and see how to do that. Will get back to you if I can figure it out
You may be able to use the Ancestors extensio to search where the ancestor is the page root. This has been discussed here:
https://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=177252
Thank you David Knipe You saved my time today. Its perfectly working for Pages , But For Blocks also we need .
Do you want to find blocks that are on pages or blocks where they are in the tree?
Irrespective of all the down blocks in the tree(for given parent). Hope you understand.
If you are looking for blocks within certain places within the tree then the Ancestors method should could work, use the content reference of the folder that the block(s) sit in.
Yes David Knipe Thanks again. Its similar but thing is i will pass the page content link and needs to get the all blocks which is created using the block type(Specific document list block) in the same page and child pages as well.
I am trying to write below for blocks:
var client = SearchClient.Instance;
var query = client.Search<DocumentListBlock>()
// .Filter(x => x.Ancestors().Match(startPage.ToReferenceWithoutVersion().ToString())) ----- Need to get the used blocks under the specified start page
.Filter(page => page.Title.PrefixCaseInsensitive("abc")).Take(1000);
var batch = query.GetContentResult();
I am not able to find the Ancestors method for blocks.
Hi Team, I would like to get the all the pages start with alphabets letters(Title Start with A,B,C..Z) under specific parent page using Epi Server Cms find query. Can anybody familier same kind of functionality?.