Skip to content

Upgrade to Lucene 6.4.0#22724

Merged
jimczi merged 5 commits intoelastic:masterfrom
jimczi:lucene_upgrade
Jan 21, 2017
Merged

Upgrade to Lucene 6.4.0#22724
jimczi merged 5 commits intoelastic:masterfrom
jimczi:lucene_upgrade

Conversation

@jimczi
Copy link
Copy Markdown
Contributor

@jimczi jimczi commented Jan 20, 2017

This change updates the dependencies to Lucene 6.4.0 and fixes the compilation errors due to some changes in Lucene API.

@mikemccand
Copy link
Copy Markdown
Contributor

LGTM, except I'm not so familiar with the ValueSource changes ... maybe @jdconrad could have a look?

@jimczi
Copy link
Copy Markdown
Contributor Author

jimczi commented Jan 21, 2017

Thanks @mikemccand .

I pushed some modifications to fix the ValueSource => DoubleValueSource conversion.
@rjernst @jdconrad can you take a look ?

Copy link
Copy Markdown
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

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

LGTM! My only concern is if any other ValueSource uses score the needsScore will be ignored by expressions in ES now (but at this time I don't think this is a problem.) It's possible I'm misreading this, though.

@jimczi
Copy link
Copy Markdown
Contributor Author

jimczi commented Jan 21, 2017

It's possible I'm misreading this, though.

You're not, we need to check if the value source needs the score as well. My last commit fixes this. The build passes for me locally, I'll push when the ci finishes.

Thanks for the review @jdconrad !

@jimczi jimczi merged commit 8028578 into elastic:master Jan 21, 2017
@jimczi jimczi deleted the lucene_upgrade branch January 21, 2017 03:48
jimczi added a commit that referenced this pull request Jan 21, 2017
* Upgrade to Lucene 6.4.0

`ValueSource`s are now converted to `DoubleValueSource`s using the Lucene adapter made for the migration to the new API in 6.4.0.
jimczi added a commit that referenced this pull request Jan 21, 2017
* Upgrade to Lucene 6.4.0

`ValueSource`s are now converted to `DoubleValueSource`s using the Lucene adapter made for the migration to the new API in 6.4.0.
public boolean advanceExact(int doc) throws IOException {
return true;
}
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you could reuse DoubleValuesSource.fromScorer(scorer) here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No we can't ;).
There is an assert in the scorer created in this function that checks that the scorer's docid is set when advanceExact is called. Though the canned scorer that we use set the docid when score is called which makes it incompatible with this helper.

DoubleValues values = source.getValues(leaf, new DoubleValues() {
@Override
public double doubleValue() throws IOException {
return Double.NaN;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would it be less trappy to throw an exception instead like we did before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same here, we can't do that. The correct fix would be to pass a null value but it's also not possible currently because some DoubleValueSources that need to access the score check that the scorer is not null when getValues is called. We could also check if the source needs the score but this information is lost in the ValueSource to DoubleValueSource conversion because the converted DoubleValueSource always returns true when needsScore is invoked.

@jimczi
Copy link
Copy Markdown
Contributor Author

jimczi commented Jan 22, 2017

Thanks @jpountz . I think there are some things to clean up in this PR but it will require some changes on our side to be able to do it. This is why I choose to push this PR as is for 5.2 but we definitely need to review this for 5.x and master.

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jan 23, 2017
* master: (33 commits)
  Docs fix - Added missing link to new Adjacency-matrix agg
  Pass `forceExecution` flag to transport interceptor (elastic#22739)
  Version: Add missing releases from 2.x in Version.java (elastic#22594)
  CONSOLE-ify filter aggregation docs
  CONSOLE-ify date_range aggregation docs
  Add single static instance of SpecialPermission (elastic#22726)
  Simplify InternalEngine#innerIndex (elastic#22721)
  Upgrade to Lucene 6.4.0 (elastic#22724)
  Fix broken TaskInfo.toString()
  Add CheckedSupplier and CheckedRunnable to core (elastic#22725)
  Revert "Make build Gradle 2.14 / 3.x compatible (elastic#22669)"
  Fixes retrieval of the latest snapshot index blob (elastic#22700)
  CONSOLE-ify date histogram docs
  CONSOLE-ify min and max aggregation docs
  CONSOLE-ify global-aggregation.asciidoc
  Fix script score function that combines _score and weight (elastic#22713)
  Corrected a plural verb to a singular one. (elastic#22681)
  Fix duplicates from search.query (elastic#22701)
  Readd unconverted snippets mark for doc
  Deguice rest handlers (elastic#22575)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants