Skip to content
Discussion options

You must be logged in to vote

It will always update. But sounds like you have a bit of a custom situation. You can override the event subscriber.

In your AppServiceProvider, add this to register.

$this->app->extend(UpdateItemIndexes::class, function ($original) {
    return config('statamic.search.auto_update')
        ? $original
        : new DontUpdateItemIndexes;
});

and create the DontUpdateItemIndexes class which is basically a dummy override.

<?php

namespace App;

class DontUpdateItemIndexes
{
    public function subscribe($event)
    {
        // do nothing
    }
}

Then add the new config key, which you can control however makes sense for you, in this case through an .env var.

// config/statamic/search.php

<…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@edalzell
Comment options

@ben-mcfetridge-resn
Comment options

Comment options

You must be logged in to vote
1 reply
@ben-mcfetridge-resn
Comment options

Answer selected by ben-mcfetridge-resn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants