alleyinteractive / wp-bulk-task

A library to assist with running performant bulk tasks against WordPress database objects.
GNU General Public License v2.0
13 stars 0 forks source link

Disable common Elasticsearch integrations by default #3

Closed kevinfodness closed 7 months ago

kevinfodness commented 1 year ago

Elasticsearch integrations cause the database WHERE clause pagination by post ID to fail, resulting in an infinite loop. Consider disabling common Elasticsearch integrations by default:

There is a note in the wiki about how to work around this for now: https://github.com/alleyinteractive/wp-bulk-task/wiki#elasticsearch

renatonascalves commented 8 months ago

@kevinfodness Correct me if I'm wrong, but is this happening even when it is not a search query?

Since the bulk task uses a regular WP_Query, I'd expect es not be used, unless some of those plugins would be activating it. No?!

For example, I have one client site that uses SearchPress and the bulk task is not using ES at all.

kevinfodness commented 8 months ago

It's probably not happening when it's not a search query. However, one of the benefits to this library is that you can use a search query performantly to identify posts that (for example) have particular text in the post body, at which point it gets picked up by the search integration with Elasticsearch, which may not return the expected results. This happened for me when using VIP Enterprise Search and would likely happen with ElasticPress itself as well. SearchPress may be smart enough to not interject itself in this type of query.

renatonascalves commented 7 months ago

I still need to confirm if SearchPress provides a similar hook. A quick look indicates it doesn't, but I'll need to check.

renatonascalves commented 7 months ago

I reviewed the SearchPress code and it only integrates with the main query. So we are good to resolve this issue.