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

Fix getDocument to return the version parameters #1973

Merged
merged 6 commits into from
Aug 26, 2021
Merged

Conversation

dsgrillo
Copy link
Contributor

No description provided.

@ruflin
Copy link
Owner

ruflin commented Aug 20, 2021

Any chance you could add a changelog and a test that confirms this fix?

@dsgrillo
Copy link
Contributor Author

Hi @ruflin, I was in a rush last week to have this working, sorry for the low quality PR.
I'd be happy to add a couple of tests to confirm the issue and update the changelog accordingly :)

@ruflin
Copy link
Owner

ruflin commented Aug 23, 2021

Thank you! I really appreciate the contribution!


$doc1 = $index->getDocument(1);

$this->assertGreaterThan(0, $doc1->getVersion());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this was 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously it would fail with: Elastica\Exception\InvalidException: Param version does not exist

@@ -170,6 +170,8 @@ public function toArray(): array
$doc = $array['more_like_this']['like'];
$doc['doc'] = $array['more_like_this']['like']['_source'];
unset($doc['_id'], $doc['_source']);
unset($doc['if_seq_no']);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to figure out how this change is related?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if_seq_no and if_primary_term parameters are now set by the fix and those parameters are not expected by the MoreLikeThis query.
Find out because of a failing test.

@ruflin ruflin merged commit 0114e1d into ruflin:master Aug 26, 2021
@ruflin
Copy link
Owner

ruflin commented Aug 26, 2021

Thank you for the contribution!

@deguif deguif added this to the 7.2.0 milestone Sep 3, 2021
@deguif deguif modified the milestones: 7.2.0, 7.1.2 Oct 21, 2021
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

Successfully merging this pull request may close these issues.

3 participants