Kamran
Kamran

Reputation: 4100

Lucene with sitecore is the index updated automatically? If not then how I can update the index?

It is the first time I am using Lucence with Sitecore and I would like to know that when ever an item is updated/edited is the Index for that item gets updated automatically or not?

If not then what is the best way to update the Lucene Index whenever an item is updated?

Sitecore documentation about Index and Searching says that " Every time you update, create or delete an item Sitecore runs a job that updates the indexes". But I am unable to find the same opinion for Lucene.

Upvotes: 0

Views: 353

Answers (2)

Vlad Iobagiu
Vlad Iobagiu

Reputation: 4118

You are looking at a wrong link. Link you provide us is 6.6 link but your question is Sitecore 7.2 tag. Starting from Sitecore 7, searching provider was changed. You need to check Sitecore 7 documentation.

In Sitecore you have few types of index updating strategies:

  1. IntervalAsynchronousStrategy (intervalAsyncCore, intervalAsyncMaster): As configured, periodically check the history engine for updated data to index. At some volume, rebuilding an index can be more efficient than updating it. The default configuration sets the CheckForThreshold property to true, causing a full rebuild of the index if the number of affected items determined from the history engine exceeds the value specified by the ContentSearch.FullRebuildItemCountThreshold setting in the Web.config file. If this setting is absent (as per the standard configuration), its default value is 100,000.Default configuration for the sitecore_core_index index of the Core database (configured in the /App_Config/Include/Sitecore.ContentSearch.Lucene.Index.Core.config Web.config include file) uses this strategy with an interval of one minute.
  2. ManualStrategy (manual): This strategy disables automatic index updating. Any index that uses this strategy requires manual or programmatic updating, although you can update any index manually programmatically. The default configuration does not apply this strategy to any indexes. You should not combine this strategy with any other index rebuilding strategies. This intent of this strategy is for specific cases such as when the entire indexing process occurs on a separate, dedicated instance, meaning that the local instance does not need to perform any indexing operations.
  3. OnPublishEndAsynchronousStrategy (onPublishEndAsync): Triggered by the publish:end and publish:end:remote events, this strategy uses the event queue to determine updated data to index incrementally. If there are no entries in the history engine for the database with timestamps after that of the index’s last update, this strategy takes no action. By default, Sitecore 7 enables the event queue as required to use this strategy. The default configuration sets the CheckForThreshold setting of this strategy to true, causing a full index rebuild if the history table indicates more than the configured number of items updated. The default configuration for the sitecore_web_index index of the default publishing target database named web configured in the /App_Config/Include/Sitecore.ContentSearch.Lucene.Index.Web.config Web.config include file applies this strategy, which is appropriate for publishing target databases. You should not combine this strategy with the SynchronousStrategy strategyor the IntervalAsynchronousStrategy. You may use this strategy with indexes that use the SwitchOnRebuildLuceneIndex implementation, which indexes to a temporary directory to avoid impacting uses of the index during indexing.

  4. RebuildAfterFullPublishStrategy (rebuildAfterFullPublish): This strategy performs a full rebuild of the index after a site publishing or any full publishing event. For a single index, you should not use this strategy conjunction with the SynchronousStrategy strategy, though you may combine it with others. If you use this strategy in conjunction with the OnPublishEndAsync strategy, be sure to register the RebuildAfterFullPublishStrategy before the OnPublishEndAsync strategy. Sitecore investigates the strategies in the order configured. With this order, you use the efficient strategy when possible (after small publishing operations), but not immediately after a full index rebuild.

  5. RemoteRebuildStrategy (remoteRebuild): Indexes managed on remote hosts can use this strategy to perform full index rebuilds after full rebuilds complete on other hosts. For example, an index in a content delivery instance could use this strategy to force rebuilds when a user rebuilds an index in the content management environment through the user interface. This strategy subscribes to the indexing:end:remote eventThe default configuration does not apply this strategy to any indexes.
  6. SynchronousStrategy (syncMaster): This strategy re-indexes updated data immediately after various events. On initialization, this strategy attaches to events in the low-level data engine to provide almost real-time index updates. In single-instance environments, this strategy guarantees index updates immediately after data changes. In multi-instance environments, this strategy works with the event queue that broadcasts remote events that trigger indexing. This is the most expensive indexing strategy in terms of machine resources and should only be used in limited circumstances. This strategy is appropriate for content management environments, and most likely never content delivery environments, unless the real time index update is absolutely critical You should not combine this strategy with any other strategy except the RemoteRebuildStrategy. The default configuration for the sitecore_master_index index of the Master database (configured in the /App_Config/Include/Sitecore.ContentSearch.Lucene.Index.Master.config Web.config include file) applies this strategy.

More information about sitecore index strategies you can find here http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2013/04/sitecore-7-index-update-strategies.aspx

https://dev.sitecore.net/sitecore%20experience%20platform/search%20and%20indexing/index%20update%20strategies

Upvotes: 2

Marek Musielak
Marek Musielak

Reputation: 27142

Lucene is default Sitecore index provider. In clean Sitecore instance it updates indexes automatically

Every time you update, create or delete an item

If you start messing with your configuration, you can brake it in multiple ways.

Upvotes: 1

Related Questions