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

Remove setNextScore in SearchScript. #6864

Closed
wants to merge 1 commit into from

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Jul 14, 2014

While it would be nice to do this all the way up the chain (into
score functions), this at least removes the weird dual
setNextScore/setScorer for SearchScripts.

import java.util.Map;

public class ScriptScoreFunction extends ScoreFunction {

static class CannedScorer extends Scorer {
Copy link
Contributor

Choose a reason for hiding this comment

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

can this class be final?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, done.

@s1monw
Copy link
Contributor

s1monw commented Jul 15, 2014

I left some comments... look good in general

@s1monw s1monw removed the review label Jul 15, 2014
@kimchy
Copy link
Member

kimchy commented Jul 16, 2014

LGTM, we should make sure we fix mvel as well, not just groovy

@s1monw
Copy link
Contributor

s1monw commented Jul 16, 2014

@kimchy Mvel it removed in master that is why it's not in the PR it's still on 1.x so I guess ryan is fixing it once he is porting the commit

While it would be nice to do this all the way up the chain (into
score functions), this at least removes the weird dual
setNextScore/setScorer for SearchScripts.
@rjernst
Copy link
Member Author

rjernst commented Jul 16, 2014

Yes, I will fix mvel in 1.x when I backport to there.

@rjernst rjernst closed this in 770447c Jul 16, 2014
rjernst added a commit that referenced this pull request Jul 16, 2014
While it would be nice to do this all the way up the chain (into
score functions), this at least removes the weird dual
setNextScore/setScorer for SearchScripts.

closes #6864
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Jul 16, 2014
…er script

engines to use.

With the removal of setNextScore in elastic#6864, script engines must use
the Scorer to find the score of a document.  The DocLookup is updated
appropriately to do this, but most script engines require a Number to be
bound for numeric variables.  Groovy already had an encapsulation for
this funtionality, and this moves it out to be shared with other script
engines.
rjernst added a commit that referenced this pull request Jul 16, 2014
With the removal of setNextScore in #6864, script engines must use
the Scorer to find the score of a document.  The DocLookup is updated
appropriately to do this, but most script engines require a Number to be
bound for numeric variables.  Groovy already had an encapsulation for
this funtionality, and this moves it out to be shared with other script
engines.

closes #6898
rjernst added a commit that referenced this pull request Jul 17, 2014
With the removal of setNextScore in #6864, script engines must use
the Scorer to find the score of a document.  The DocLookup is updated
appropriately to do this, but most script engines require a Number to be
bound for numeric variables.  Groovy already had an encapsulation for
this funtionality, and this moves it out to be shared with other script
engines.

closes #6898
@clintongormley clintongormley changed the title Remove setNextScore in SearchScript. Scripting: Remove setNextScore in SearchScript. Sep 8, 2014
brwe added a commit to elastic/elasticsearch-lang-javascript that referenced this pull request Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here.

See elastic/elasticsearch#6864
See elastic/elasticsearch#7819

Closes #23.
(cherry picked from commit 5e5c373)
brwe added a commit to elastic/elasticsearch-lang-javascript that referenced this pull request Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here.

See elastic/elasticsearch#6864
See elastic/elasticsearch#7819

Closes #23.
brwe added a commit to elastic/elasticsearch-lang-javascript that referenced this pull request Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here.

See elastic/elasticsearch#6864
See elastic/elasticsearch#7819

Closes #23.
(cherry picked from commit 5e5c373)
brwe added a commit to elastic/elasticsearch-lang-python that referenced this pull request Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here.

See elastic/elasticsearch#6864
See elastic/elasticsearch#7819

Closes #16.
Closes #21.
brwe added a commit to elastic/elasticsearch-lang-python that referenced this pull request Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here.

See elastic/elasticsearch#6864
See elastic/elasticsearch#7819

Closes #16.
Closes #21.

(cherry picked from commit cd7756c)
brwe added a commit to elastic/elasticsearch-lang-python that referenced this pull request Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here.

See elastic/elasticsearch#6864
See elastic/elasticsearch#7819

Closes #16.
Closes #21.

(cherry picked from commit cd7756c)
@rjernst rjernst deleted the fix/script-scorer branch January 21, 2015 23:22
@clintongormley clintongormley added the :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache label Jun 7, 2015
@clintongormley clintongormley changed the title Scripting: Remove setNextScore in SearchScript. Remove setNextScore in SearchScript. Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement v1.4.0.Beta1 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants