Try our conversational search powered by Generative AI!

Get search result under specific page



Our search results must depend on what part of the tree is now user.

How should we configure search request to search under specific content reference?

Search result should includes root page (provided as content reference to request) and children pages.

Best regards,


Nov 06, 2015 9:56


you could filter on ancestors:

.Filter(x => x.Ancestors().Match(somePage.ContentLink.ID)) 
Nov 06, 2015 10:29

Or if you use UnifiedSearch you could/should use:

.Filter(x => !x.MatchTypeHierarchy(typeof(PageData))
                            | ((PageData)x).Ancestors().Match(somepage.PageLink.ToString()))
Nov 06, 2015 11:13

Henrik Fransas I have several question according to your code:

1) Do you know where this code will be executed (EPiServer application OR EPiServer Find server)?

2) Is Filter always to be performed on the application side or search side?

3) I saw that 'Ancestors' property presents in the EPiServer Find index. 

Is it possible to add filter to search request by property name without type conversion? 

Nov 09, 2015 15:28

1. EPiServer Find server

2. Search side

3. Don't worry about the type conversion. It will never actually be invoked, as the Find search query will only look at the Field Name, which is "Ancestors" in this case. This also means that the "Ancestors" method will only be invoked when you index the content, and never when running the query. When the query is run, it will look for a property with the same name (Ancestors) in the index.

Nov 09, 2015 15:32

Thanks guys for your answers

Nov 10, 2015 6:28
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.