-
Notifications
You must be signed in to change notification settings - Fork 730
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
Conversation
Fix getDocument to return the version params
Any chance you could add a changelog and a test that confirms this fix? |
Hi @ruflin, I was in a rush last week to have this working, sorry for the low quality PR. |
Thank you! I really appreciate the contribution! |
|
||
$doc1 = $index->getDocument(1); | ||
|
||
$this->assertGreaterThan(0, $doc1->getVersion()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this was 0?
There was a problem hiding this comment.
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
src/Query/MoreLikeThis.php
Outdated
@@ -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']); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Thank you for the contribution! |
No description provided.