Find through pages of Page Types created through admin mode


I'm working on to implement the Free-Text-Search in my EPiServer 6R2 site. I have downloaded the latest Find.EPiServer dlls - EPiServer.Find, EPiServer.Find.CMS, EPiServer.Find.Framework and Newtonsoft.Json from "" and referenced the same in my solution.I have gone through the samples in mentioned
 However, I believe that all these methods can be implemented only when the Page Types are created through Page-Builder. When we want to search through pages that are created through admin mode, we got to use the method ".InField(x => x.SearchText())", so that the fields that are marked as searchable can be queried upon. However, I not able to find the x.SearchText() method under "EPiServer.Find" namespace. Can any one let me know the namespace that I need to add in order to find the SearchText method. Also I would like to know the options available to implement the Free-Text-Search for pages of Page Types that are created through admin mode. Thank you.

/Rajesh B

Nov 05, 2012 11:27


SearchText is an extension method for PageData and you can do InField(x => x.SearchText()) IF you are searching for PageData, ie:

.InField(x => x.SearchText()) //x is of type PageData

If you can't get it to work, please paste your code here.

Nov 05, 2012 17:56


I have pasted my code below:

using System;

using System.Collections.Generic;

using System.Web;

using System.Web.UI;


using System.Web.UI.HtmlControls;

using EPiServer;using EPiServer.Core;

using EPiServer.DataAbstraction;

using EPiServer.Web.WebControls;

using EPiServer.Find;

namespace EPiServer


publicpartialclassFindEPiServer : EPiServer.TemplatePage


protectedIClient client = Client.CreateFromConfig();protectedvoid Page_Load(object sender, EventArgs e)


if (!IsPostBack)





protectedvoid Search()


var result = client.Search<PageData>().For("about-us").InField(x => x.SearchText()).GetResult();




However, on compiling I get the following error:

'EPiServer.Core.PageData' does not contain a definition for 'SearchText' and no extension method 'SearchText' accepting a first argument of type 'EPiServer.Core.PageData' could be found (are you missing a using directive or an assembly reference?)

Nov 06, 2012 7:59

You're missing a using statement:

using EPiServer.Find.Cms;


Also, instead of Client.CreateFromConfig, use SearchClient.Instance.

Read more on the EPiServer/CMS integration here.

Nov 06, 2012 8:11

Hi Joel,

I have "EPiServer.Find.Cms" now and the following query returns the results:

var result = SearchClient.Instance.Search<PageData>().For(Query).InField(x => x.SearchText()).GetResult()

Thank you for your help.


Edited, Nov 08, 2012 15:18
* 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.