WP-CLI serves as the command-line interface for WordPress, offering a range of commands for various actions typically executed in the WordPress admin.
Within the framework of the Search With Typesense plugin, our plugin introduces its own set of WP-CLI commands. These commands enable you to index and delete post types, with the flexibility to specify particular IDs. Additionally, the plugin provides an option to assess the health status of the Typesense server.
This is very helpful if you have command line access to your WordPress installation instace on your server.
Kindly be aware that the subsequent commands will not remove your posts from the WordPress database. Instead, these commands exclusively index or delete the posts on your Typesense Server.
Note: We intend to incorporate additional commands in the future based on your requests. Your feedback would be highly valuable.
wp typesense index
Index a specific post type to Typesense server
The comma separated IDs of the posts of that post type you want to index.
# Index all the default posts $ wp typesense index post
# Index all only specific posts with IDs: 2,3 and 4 for the custom post type 'books' $ wp typesense index books --ids=2,3,4
wp typesense delete
Delete a specific post type from Typesense server
Slug of the post type you want to delete.
The comma separated IDs of the posts of that post type you want to delete.
# delete all the default posts $ wp typesense delete post
# delete all only specific posts with IDs: 2,3 and 4 for the custom post type 'books' $ wp typesense delete books --ids=2,3,4
wp typesense health
Check the health status of your Typesense server.
$ wp typesense health