Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Segment Replication] Support realtime TermVector requests with Segment Replication #9585
[Segment Replication] Support realtime TermVector requests with Segment Replication #9585
Changes from all commits
4012c16
6f429b6
2e778ec
ae589df
5d9ccb4
b11e4ec
89a4588
2648fd4
b71681f
4e43c57
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 97 in server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java
Codecov / codecov/patch
server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java#L97
Check warning on line 103 in server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java
Codecov / codecov/patch
server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java#L103
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.
@Rishikesh1159 I don't think the primary override here is necessary. In this case, an "artificial" document has been supplied and the user is asking to compute term vectors as if this was a real document. I don't think the "real time" parameter is applicable here since it doesn't need to look up any index data.
@msfroh Does that sound right to you?
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.
That does sound right to me.
I think the override condition should be:
Or you could revert the edit to this line and continue to use
request.request().preference()
for the artificial doc case.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.
Interestingly the code seems to unconditionally attempt to fetch the document even if an artificial document is supplied. Not sure if that complicates things here.
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.
I think that's probably worth fixing -- from the looks of it, that
GetResult
is ignored, which seems a little wasteful.That said, I don't think it hurts anything. In particular, if the
doc
parameter is specified, then it GETs a document with ID based on an autoincrementing (not really random) integer:OpenSearch/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java
Lines 315 to 323 in aca2e9d
(
generateRandomId
is always true on the REST parsing code path.)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.
Still, there is no value in routing to a primary shard if an artificial doc is specified.