Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-index Data failing when some post have the same post_dates #143

Open
nigelheap opened this issue Dec 10, 2016 · 0 comments
Open

Re-index Data failing when some post have the same post_dates #143

nigelheap opened this issue Dec 10, 2016 · 0 comments

Comments

@nigelheap
Copy link

This is actually kind of an issue in mysql but... when you have post_date fields that are the same.
LIMIT and OFFSET has a pretty hard time working correctly.

The problem follows though into wordpress and the get_post() function.

The reason I have posts with the same date is because they are being bulk imported and some of them are imported in the same second.

Here is an example of the ids sent to the indexer in the first 2 loops

First block of 10
[0] => 6768
[1] => 6769
[2] => 6766
[3] => 6767
[4] => 6765
[5] => 6719
[6] => 6718
[7] => 6724
[8] => 6720
[9] => 6723

Second block of 10
[0] => 6732
[1] => 6729
[2] => 6718
[3] => 6719
[4] => 6724
[5] => 6734
[6] => 6730
[7] => 6733
[8] => 6725
[9] => 6726

You can see that 6719, 6718 and 6724 are in both the loops. This means that the post count ends up being incorrect and the indexer never indexes everything.

I know that in your plugin that you can overwrite the arguments being send to the indexer with
elasticsearch_indexer_get_posts but I might be better to order them by ID or maybe give the option in the interface because this might stump some people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant