Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Ability to disable index on publish #202

Open
AThraen opened this issue Apr 24, 2023 · 2 comments
Open

Feature Request: Ability to disable index on publish #202

AThraen opened this issue Apr 24, 2023 · 2 comments

Comments

@AThraen
Copy link

AThraen commented Apr 24, 2023

In some cases, for example when you have a scheduled job that will regularly update a lot of content it will slow down the process tremendously if an index method is called for each content item. It would be very useful if there was a way to disable (at least temporarily) when doing major updates, and then re-enable after.

@otanum
Copy link
Contributor

otanum commented Apr 25, 2023

Normally indexing is way faster than saving content.

Is it possible to do the opposite of the Initializer in your scheduled job?
https://github.com/Epinova/Epinova.Elasticsearch/blob/07cbd4337597ded490c1a28499636ba8cc72e971/src/Epinova.ElasticSearch.Core.EPiServer/Initialization/IndexingInitializer.cs

First remove events and then readd them when job is finished.

@AThraen
Copy link
Author

AThraen commented Apr 26, 2023

I was considering doing exactly that, but since the event handlers (IndexingEvents) are marked internal it's not straight forward. A simple solution could be to mark it public - then I'll give it a try :-)

A scheduled job that runs a few times a day and syncs products with salesforce used to take 10 minutes, now takes 50 minutes. Only change is the addition of the commerce integration. For reasons beyond my control the sched. job deletes and then recreates a lot of content - which probably causes both a lot of individual deletes and a lot of individual index calls to happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants