The document "Working with Pages Programmatically" should mention about page reindex

At my work, I created many pages programmatically with this document.

When I checked page searching function, those pages were not found. The cause is missing reindexing pages by the below code.

$p = Page::add($data);
$p->reindex(); // Required to be searched.

I had spent too much time finding the cause.
Programmatically create pages will use in cases like much creation at building new sites or renewal, etc.

Hi @junmedia2 - thanks for pointing that out.

It seems like pages should be indexed when they’re created programatically. You might submit that as a Github issue here:

On the documentation front, you can actually submit edits for approval (there’s an edit link near the page title) - here’s the link where to do that for this page, that would be super helpful - thanks!