I use the following code to search data
var pages = client.Search<PageData>().For(model.SearchText) .InAllField().GetPagesResult();
One page contains word 'Chicken' in XhtmlString property.
Data is indexed and this word is in the index.
If I'm looking through 'Explore Index' (application/Find/IndexOverview/Explore) then I got this page in results.
Why sometimes the code shown above does not find this page?
I hope for your help.
Exactly what are you searching for, is it Chicken?Looking at the question I am thinking that you should use UnifiedSearch instead of Search, since you are searching all pagedata in all fields. You should also try to use SearchClient.Instance instead of an instans of client since there are a lot of conversions that you might missing.To write the question you do with UnifiedSearch it should be:SearchClient.Instance.UnifiedSearchFor(model.SearchText).GetResult();That will not give you back Pagedata, but it is not hard to convert it, see more info here:http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-Find/75/DotNET-Client-API/Searching/Unified-search/
I try the proposed version, but I can not get the link to the page (ContentReference) or IContent.
What better way to get IContent data from UnifiedSearchHit?
If your using the UnifiedSearch you should be getting a ISearchContent back, so unless your doing some projections you should have a SearchHitUrl property. Does this not exist?
I have following "/en/recipe-listing/resipe-3/product-1/" but I need ContentReference.
UnifiedSearch does not give back a contentReference because it can return files and so on (maby the latest version do, I have not tried that). So if you need that, you have to do a extension method that get the content by the url.
Read Joels good article on this:
Thanks for your help and for what you sent me in the right direction