Skip Navigation

[Resolved] Elastic Search fatal error when indexing

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 5 years, 2 months ago.

Assisted by: Nigel.

Author
Posts
#1336445

Hi Toolset,

I'm trying to index with Elastic Search and get this error:

Fatal error:
PHP Fatal error: Uncaught InvalidArgumentException: All provided arguments for a related element must be either an ID or a WP_Post object. in /***//wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/related_posts.php:228
Stack trace:
#0 /***//wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/related_posts.php(163): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->set_query_by_elements(Array, 'parent')
#1 /***//wp-content/plugins/types/vendor/toolset/toolset-common/inc/public_api/m2m.php(107): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->__construct(false, 'reviews-company', Array)
#2 /***//wp-content/mu-plugins/life-reviews.php(73): toolset_get_related_posts(false, 'reviews-company', 'parent')
#3 /wp-content/mu-plugins/life-reviews.php(37): lifejobs_get_r in /var/www/eulifejo-taloyen/wordpress/current/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/related_posts.php on line 228
Fatal error: Uncaught InvalidArgumentException: All provided arguments for a related element must be either an ID or a WP_Post object. in /wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/related_posts.php:228
Stack trace:
#0 /wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/related_posts.php(163): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->set_query_by_elements(Array, 'parent')
#1 /wp-content/plugins/types/vendor/toolset/toolset-common/inc/public_api/m2m.php(107): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->__construct(false, 'reviews-company', Array)
#2 /current/wp-content/mu-plugins/life-reviews.php(73): toolset_get_related_posts(false, 'reviews-company', 'parent')
#3 /wp-content/mu-plugins/life-reviews.php(37): lifejobs_get_r in /var/www/eulifejo-taloyen/wordpress/current/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/related_posts.php on line 228

Any idea how to solve this?

Thanks,
Menno

#1336509

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Menno

Can I check how you are adding Elastic Search to your site?

#1336513

Hi Nigel,

Sure, we use ElasticPress.io now. What details do you want to know?

Thanks,
Menno

#1336515

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That's what I wanted to know, presumably with the ElasticPress plugin.

I'll need to see if we can set up such a test site, I'll get back to you.

#1336517

I can setup a staging in a few minutes if you want. Yes we use the plugin.

#1336529

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That would be helpful to confirm the issue, although we'll eventually need to create a local site for testing, and for that we'll need to set up an account with ElasticPress, so we'll need to contact them.

My colleague points out that there is no integration with ElasticPress, so it can't be used with Views search and filtering, though of course it shouldn't be generating fatal errors.

(WPSolr who also use ElasticSearch do have an integration with Toolset: hidden link and hidden link)

Let me mark your next reply as private to get credentials for the staging site.