Skip to content

Conversation

@winstonewert
Copy link
Contributor

Corrects the ScriptedMetricAggregator so that the script can have
access to scores during the map stage.

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@colings86
Copy link
Contributor

jenkins test this

Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

@winstonewert Thanks for raising this PR. I left a couple of comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you have the score scripts as separate scripts rather than repurposing the existing ones? I think its important that we continue testing scripts that don't use score as well as scripts that do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should test cases with score separately from those without scores and retain both types of test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@winstonewert
Copy link
Contributor Author

I've pushed a new commit fixing the issues mentioned. Thanks for your time in reviewing it.

@colings86
Copy link
Contributor

jenkins retest this

@clintongormley clintongormley changed the title Fixes #24259 Allow scripted metric agg to access _score Apr 25, 2017
@winstonewert
Copy link
Contributor Author

I see that the build failed. But it looks like there was an unrelated change in the test? I'm guessing it has something to do with changes having been made since I forked? But I'm not sure how to update my version without breaking the review process here.

Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

@winstonewert Thanks for updating the tests I think this looks good now. Could you rebase your branch with the latest master branch (git rebase master) and we'll give the tests another go at running before we merge?

Corrects the ScriptedMetricAggregator so that the script can have
access to scores during the map stage.
As requested, I've restored the non-score dependant tests, and added the
score dependent metric as a seperate test.
@colings86
Copy link
Contributor

jenkins retest this

@winstonewert
Copy link
Contributor Author

I haven't rebased much in the past, and I had to try several times to get it right. Let me know if I still got it wrong.

@colings86
Copy link
Contributor

@winstonewert that looks right now, thanks. I think I was a bit fast kicking off that build so will do it again

@colings86
Copy link
Contributor

jenkins retest this

@colings86 colings86 merged commit c1ba4fd into elastic:master May 2, 2017
colings86 pushed a commit that referenced this pull request May 2, 2017
* Fixes #24259

Corrects the ScriptedMetricAggregator so that the script can have
access to scores during the map stage.

* Restored original tests. Added seperate test.

As requested, I've restored the non-score dependant tests, and added the
score dependent metric as a seperate test.
colings86 pushed a commit that referenced this pull request May 2, 2017
* Fixes #24259

Corrects the ScriptedMetricAggregator so that the script can have
access to scores during the map stage.

* Restored original tests. Added seperate test.

As requested, I've restored the non-score dependant tests, and added the
score dependent metric as a seperate test.
@colings86 colings86 removed the v5.3.3 label May 2, 2017
@colings86
Copy link
Contributor

@winstonewert thanks for raising this PR. I have merged and backported this and it will be available from the 5.4.1 release. Thanks for your contribution

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request May 2, 2017
* master: (27 commits)
  Check index sorting with no replica since we cannot ensure that the replica index is ready when forceMerge is called. Closes elastic#24416
  Docs: correct indentation on callout
  Build that java api docs from a test (elastic#24354)
  Move RemoteClusterService into TransportService (elastic#24424)
  Fix license header in WildflyIT.java
  Try not to lose stacktraces (elastic#24426)
  [DOCS] Update XPack Reference URL for 5.4 (elastic#24425)
  Painless: Add tests to check for existence and correct detection of the special Java 9 optimizations: Indified String concat and MethodHandles#ArrayLengthHelper() (elastic#24405)
  Extract a common base class to allow services to listen to remote cluster config updates (elastic#24367)
  Adds check to snapshot repository incompatible-snapshots blob to delete a pre-existing one before attempting to overwrite it.
  Added docs for batched_reduce_size
  Fixes checkstyle errors
  Allow scripted metric agg to access `_score` (elastic#24295)
  [Test] Add unit tests for HDR/TDigest PercentilesAggregators (elastic#24245)
  Fix FieldCaps documentation
  Upgrade to JUnit 4.12 (elastic#23877)
  Set available processors for Netty
  Painless: Fix method references to ctor with the new LambdaBootstrap and cleanup code (elastic#24406)
  Doc test: use propery regex for file size
  [DOCS] Tweak doc test to sync_flush
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants