Now when we first build the indexes we just navigate to the home page and the indexes are built. It seems though that the extra fields aren't added to these indexes. If however I go to backoffice and rebuild the indexes then the extra fields are added.
I tried moving the Application started event to a starting or initialization event, but got an error "Resolution is not frozen, it is not yet possible to get values from it.", so that doesn't seem to do the job.
How should we do this? Or is navigating to the home page first up the wrong way to build the indexes?
Thanks for the reply. We do have the config files set up, but the fields we are adding are calculated fields and so we use IndexerOnGatheringNodeData, shouldn't that be used? How would you add calculated fields to the config file?
I'm aware of this, again how does this help if I want to index a derived field? for example I want to add a boolean flag if a few fields are set to particular values? This does seem a fairly common practice with Umbraco/examine e.g. http://thecogworks.co.uk/blog/posts/2012/november/examiness-hints-and-tips-from-the-trenches-part-2/ . The problem I'm experiencing is that the indexes aren't being built correctly on initialisation if you use calculated fields, as I said up top. I son't see anywhere in the link you've provided that addresses this? or am I missing something?
I found myself in the same situtation - trying to enrich my ExternalIndexer index with additional data and I got the same "resolution is not frozen..." error.
I solved it by moving my code from OnApplicationStarting to OnApplicationStarted.
Adding extra fields to an index isn't working when the application first starts
Our umbraco application has a number of indexes with calculated fields added to the index.
Currently the fields are added in an ApplicationStarted event like so
and one of our routines to add the fields is something like this
Hi Dave,
You don't need to specify your own 'IndexerOnGatheringNodeData', you can just use /config/ExamineIndex.config and add 'IndexSet'
Try to look here :
http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine
http://our.umbraco.org/forum/developers/api-questions/56389-Exclude-nodes-in-examineIndex
Thanks, Alex
Hi Alex,
Thanks for the reply. We do have the config files set up, but the fields we are adding are calculated fields and so we use IndexerOnGatheringNodeData, shouldn't that be used? How would you add calculated fields to the config file?
cheers,
Dave
Hi Dave,
Umbraco has build in wrapper for Lucene, called Examine.
http://our.umbraco.org/documentation/reference/Searching/Examine/
You don't need override application events for gathering data, you just write it in the config file.
Thanks, Alex
Hi Alex,
I'm aware of this, again how does this help if I want to index a derived field? for example I want to add a boolean flag if a few fields are set to particular values? This does seem a fairly common practice with Umbraco/examine e.g. http://thecogworks.co.uk/blog/posts/2012/november/examiness-hints-and-tips-from-the-trenches-part-2/ . The problem I'm experiencing is that the indexes aren't being built correctly on initialisation if you use calculated fields, as I said up top. I son't see anywhere in the link you've provided that addresses this? or am I missing something?
Thanks,
Dave
Hi,
I found myself in the same situtation - trying to enrich my ExternalIndexer index with additional data and I got the same "resolution is not frozen..." error.
I solved it by moving my code from OnApplicationStarting to OnApplicationStarted.
Cheers Bjørn
is working on a reply...