Content is not indexed immediately when it is published


We've noticed that it takes a while for content to be indexed.

The problem is that some of our clients expect it to work immediately; they want to be able to find a certain content item right away when they search for it, after creating it.
  1. Create the content item.
  2. Search for it, using a term that exists somewhere in the indexed fields of the content item.
  3. Notice that it does not get found.
  4. Go to indexes in the admin, rebuild or update the index.
  5. Search again.
  6. Notice that it does get found.


hkui wrote Nov 8, 2013 at 1:31 PM

Possible solutions:
  • Index it immediately? Can be not so interesting, performance-wise.
  • Index more regularly.
  • Check if the index is still up-to-date before searching?

AimOrchard wrote Nov 8, 2013 at 2:17 PM

I really do not see how indexing it immediately will cause any issues.

'Worst' case scenario: what about an opt-in (or out) at the 'part/content type' level?

You could create your own module in the meanwhile though and listen for the relevant content events.

sebastienros wrote Nov 8, 2013 at 5:40 PM

In theory it should be automatic, as there is an event to trigger the indexing process when a content item is published ... will look into that.

Piedone wrote Nov 9, 2013 at 10:07 PM

When the item is published immediately only an IndexingTaskRecord is created, i.e. an entry for the item to be indexed in the next batch.

Such indexing happens once per minute (50 item batches) so if you publish 60 items at once (automatically e.g.) then an editor one additional item your editor will only see indexing happen after about two minutes, and so on.

Indexing more frequently is not really possible without more frequent background tasks (what we could have BTW, like every ten seconds, what do you think?). Item-level indexing, however, could happen when saving it (wouldn't really be noticeable). However then there's the question how not to do the same when publishing items in the dozens simultaneously.

sebastienros wrote Mar 15, 2014 at 2:09 AM

@Piedone, I am pretty sure that not only the index record is created, but that there is a new task in the processing engine to trigger the actual processing of it. Unless there are more than 50 items already waiting.

hkui wrote Mar 15, 2014 at 8:33 AM

Can't we make it a priority queue? That way we could give certain tasks priority. For example indexing. It wouldn't hurt performance, because these indexing tasks are fast.

And they facilitate the basic working (being able to find newly published content immediately) of the CMS, so that is a food reason to have it.

Piedone wrote Jul 29, 2014 at 11:50 AM