Automatic sync new posts
-
Hi,
Does the Search with Typesense plugin automatically sync new posts, post updates, and deleted posts to Typesense after the initial manual indexing?
In other words, once we run the initial index, will the plugin hook into
save_post/update_post/delete_post(or equivalent WordPress actions) so that content changes are reflected in Typesense automatically, or do we need to manually re-index again?Thanks in advance for clarifying!
-
Hi @flaviusv
Yes, the plugin handles the states of CRUD.
You only need to index the posts once.Hi,
Than you for clarification. We have successfully indexed all 310,000 posts from our DB, but now we face another challenge: there are more new articles than new articles sent to the TS index, on daily basis. And this situation created a gap between the number of articles from database and the number of articles from TS index.
For example, in a day there are 400 new articles, but only 100 are being sent to TS index during that day. By doing this, the gap is increasing each day.
Could you please help us figure out what we should do to successfully sent all new articles from our WP database to TS index on daily basis – for adding the new content, not for reindexing from scratch – in a way we would have the TS index up to date?
Do we need to send to the index manually by actioning the Index button from “…?page=codemanas-typesense&tab=search-configuration”, or we should run on daily basis the index WP CLI command (by raising a daily ticket to our hosting)? Or maybe there is other solution.
Many thanks!
Hi @flaviusv
How are you adding the new articles is a question that will need to be asked.
By default – the plugin – automatically indexes all new posts on addition.So if you’re doing something specific please let me know.
Hi,
we are adding new articles as posts from parsing the Official Journal, every morning. But it seems the plugin can;t send all the articles to the TS index.
Here is a breakdown:
08.10
07:41 312691 (sent to TS index)
11:16 312791
14:30 312825 stop wp cli total: 312.918
23:19 312879
09.10 total: 313.222
07:44 312924
15:07 312970
10.10
08:35 313057 total: 313.470
15.10
09:47 313627 total: 314.590
16:10
09:23 313774 total: 314.836
17.10
09:27 313827 total: 314.964
Hi Again,
You shouldn’t need to run CLI to index the posts.
It should automatically index the posts when post is created.
Please try doing this:- Enable debug log.
- Adding a post manually.
- And see what that debug log shows.
Hi,
I will pass to our dev this, and will see what is happening on Monday when the parser will run again.
Meanwhile, how we can send to TS index the remained, not indexed, aprox 1100 posts?
regards,
Hi,
meanwhile will wait for the parser to load new content tomorrow, we have found this logs in error log:
PHP Fatal error: Uncaught Error: Undefined constant “Codemanas\Typesense\CODEMANAS_TYPESENSE_ROOT_DIR_PATH” in /home/HOST/public_html/wp-content/plugins/search-with-typesense/includes/Bootstrap.php:81
Stack trace:0 /home/HOST/public_html/wp-content/plugins/search-with-typesense/includes/Bootstrap.php(42): Codemanas\Typesense\Bootstrap->autoload()
1 /home/HOST/public_html/wp-content/plugins/search-with-typesense/includes/Bootstrap.php(26): Codemanas\Typesense\Bootstrap->__construct()
2 /home/HOST/public_html/wp-content/plugins/search-with-typesense/includes/Bootstrap.php(163): Codemanas\Typesense\Bootstrap::getInstance()
3 phar:///home/HOST/public_html/wp/vendor/wp-cli/wp-cli/php/utils.php(160): require_once(‘/home/HOST/pub…’)
4 phar:///home/HOST/public_html/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadRequiredCommand.php(56): WP_CLI\Utils\load_file(‘/home/HOST/pub…’)
5 phar:///home/HOST/public_html/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(84): WP_CLI\Bootstrap\LoadRequiredCommand->process(Object(WP_CLI\Bootstrap\BootstrapState))
6 phar:///home/HOST/public_html/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(35): WP_CLI\bootstrap()
7 phar:///home/HOST/public_html/wp/php/boot-phar.php(20): include(‘phar:///home/HOST…’)
8 /home/HOST/public_html/wp(4): include(‘phar:///home/HOST…’) 9 {main}
thrown in /home/HOST/public_html/wp-content/plugins/search-with-typesense/includes/Bootstrap.php on line 81
PHP Warning: Undefined property: stdClass::$fields in /home/HOST/public_html/wp-content/plugins/search-with-typesense/templates/instant-search.php on line 33
Hi,
I ran some checks and found that the TS index is up to date, the last post was sent to the TS server, leaving aside the discrepancy between the number of posts in the database and the number of documents in the TS index.
Another problem I discovered is that certain posts in the TS index are associated with the Uncategorized category, instead of having their own category assigned to them. Do you know how could we fix this?
The topic ‘Automatic sync new posts’ is closed to new replies.