Algolia Plugin - Page not indexed

I am using the Algolia plugin and have run into an issue. I am using the filter option to only index visible pages for a certain template. But when I create a page of this template type in the panel, it being created as invisible. Since the page is invisible at creation, it doesn’t meet the filter criteria, so the index record for the page is never created. Updates to the page after it is made visible don’t create the index record either. I am open to thoughts how I could deal with this.

Possible Solutions

I am currently creating the pages as invisible because further processing needs to happen before they are ready to be used. (The page is for a podcast entry and it isn’t made visible until after an audio file is uploaded (and converted if necessary.) I could add the algolia()->insertPage($page) call to the hook after the page is made visible. Wondering if there are any potential problems with this method.

I could also remove the filter and allow pages to be index even if they are invisible. Might need to make other adjustments so that these pages do not show up in search results.

Is there are way to check if an index record exists and perhaps create it on update if it doesn’t?

I am open to other suggestions.

Hm, I wonder if that would make any difference, because both the insertPage() and the updatePage() methods actually do the the same, i.e. call

 $this->getIndex()->saveObject(static::formatPage($page));

The question is why the record doesn’t get created on page update.

Thanks. That will help with debugging. The hooks for creating and updating pages were definitely working on the test site. And I know the manual refresh of the index works on the live site. I am not seeing any errors and nothing in the error log. I will update once I figure out what is wrong.