Indexing not working



What can be the problem when a page isn't indexed when you change or publish it. If I run the scheduled task it will pop up in my result, but not after a publish.

Do I need to add something to my solution?


Apr 09, 2015 10:53

There exist a flag that you can set in appsettings that turns of the automatic indexing, but you have to set it manually for it to work. It is called EventedIndexingEnabled and are true by default.

Do you get any messages in the log files that indicates that you have any other problem when saving/publishing?

Apr 09, 2015 10:59

Found an error in my log.

I have a property. A block called PersonBlock that basically just have an emailaddress as value. But this is what the log says;
However. I do have two values with [Ignore] attribute on. Profilepage is one of those values.

2015-04-09 11:11:08,347 [16] ERROR EPiServer.Find.Cms.ContentEventIndexer: An exception occured while indexing (IContent). Error getting value from 'ProfilePage' on 'Castle.Proxies.PersonblockProxy'..
Newtonsoft.Json.JsonSerializationException: Error getting value from 'ProfilePage' on 'Castle.Proxies.PersonblockProxy'. ---> System.ArgumentNullException: The provided content link does not have a value.
Parameter name: contentLink
   at EPiServer.Core.DefaultContentLoader.Get[T](ContentReference contentLink, LoaderOptions loaderOptions)
   at Intranet.Models.Blocks.Personblock.get_ProfilePage() in c:\Projects\Intranet\Intranet\Models\Blocks\Personblock.cs:line 50
   at GetProfilePage(Object )
   at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)
        public ContentReference ProfilePage
                var repository = ServiceLocator.Current.GetInstance<IContentRepository>();
                return repository.Get<StartPage>(ContentReference.StartPage).MyProfilePage;

Must be this that causes the error. 

Edited, Apr 09, 2015 11:19

Solution was to add [JsonIgnore] attribute to the property :-) 

Apr 09, 2015 11:52

You were faster than me, that was what I was about to suggest since the error where when serialization the error.

Great that it works!

Apr 09, 2015 12:04

Thank you for the help :-)

Apr 09, 2015 12:05

It's a good practise in other aspects as well as Find usage to keep logic out of the getters.

I think your property would've worked fine to Find-index and Find-filter on if it had been a plain public ContentReference ProfilePage { get; set; } and you would've set it in your ContentType class constructor.

Apr 09, 2015 13:33

Old thread, but came up while I was searching for a solution for the exact same problem (epi find v11).

Haven't found the reason to why indexing stopped working when publishing pages, while reindexing from admin worked. But by running indexing in the same thread as the web, it worked as intended again (can mention that I never got logging of episerver indexing to work). 

Added this to a InitializableModule with dependency of IndexingModule (should probably work in global asax as well):

ContentIndexer.Instance.Invisible = false;

Mar 07, 2016 17:06
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.