JDK-8178275 : Ensemble: Upgrade version of Lucene to 7.1.0
  • Type: Bug
  • Component: javafx
  • Sub-Component: samples
  • Affected Version: 8,9,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-04-06
  • Updated: 2020-01-31
  • Resolved: 2017-11-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10Fixed 8u172Fixed
Related Reports
Duplicate :  
Relates :  
Description
We are using an older version of Apache Lucene, v3.2.0, in Ensemble for searching. We should upgrade to a more recent version.
Comments
+1 -phil
21-12-2017

Webrev for 8u backport: http://cr.openjdk.java.net/~kcr/8178275/8u/webrev.00/ The patch mostly applied cleanly, with the following exceptions: 1) I had to manually apply the patch to build.gradle and the Ensemble8 build.xml and project.properties files. 2) I regenerated the index files using the same recipe as I did for 10, since the ones for FX 10 were done using JDK 9 (not sure it matters, but it seemed safer). I diff'ed the two patches and there were no unexpected diffs. The modified .java files are all identical after the patches.
21-12-2017

Changeset: 3932162186a7 Author: kcr Date: 2017-11-28 07:49 -0800 URL: http://hg.openjdk.java.net/openjfx/10-dev/rt/rev/3932162186a7 8178275: Ensemble: Upgrade version of Lucene to 7.1.0 Reviewed-by: aghaisas, prr
28-11-2017

+1
28-11-2017

+1 -phil.
27-11-2017

I realized that gradle clean doesn't clean the copied Lucene jar files, so I have updated the fix with the small change. The updated webrev is here: http://cr.openjdk.java.net/~kcr/8178275/webrev.01/ Here is the delta webrev between the .00 and .01 versions: http://cr.openjdk.java.net/~kcr/8178275/delta.00.01/
27-11-2017

First of all, I must admit that I am not much familiar with this area of the code. I have tested this patch on Windows 7, Linux (Ubuntu) and MacOS. It does download the lucene-*-7.1.0.jar files as claimed. I was able to build, launch and play with the Ensemble8 sample on all above platforms. I ran through the diffs. The changes look good. +1.
27-11-2017

Webrev for review: http://cr.openjdk.java.net/~kcr/8178275/webrev.00/ Ensemble8 currently uses Lucene 3.2.0, which is four major versions out of date. In order to upgrade to the latest version of Lucene, which is 7.1.0, I had to make a few code changes to adapt to API that has changed in incompatible ways. I also changed the way we get the Lucene libraries: Rather than checking the new lucene-*-7.1.0 jar files into our repo, we will download them from maven central (as we do already with antlr and junit). I also fixed the issue with duplicate (and poorly named) filenames in META-INF as reported in JDK-8177473. Here is a summary of the changes: 1. Removed lucene-*-3.2.0.jar from the repo and updated all references from lucene-*-3.2.0.jar to lucene-*-7.1.0.jar. Note that we now need three jar files instead of two, since the queryparser functionality was refactored into a separate jar file. 2. Added logic to rt/build.gradle to download the three lucene-*-7.1.0.jar files and copy them into Ensemble8/lib at build time. 3. Modified the build logic in Ensemble8/build.xml to exclude the duplicate NOTICE.txt and LICENSE.txt files and rename them at build time, so we will no longer have to do this manually (which is what we had to do for the binary that we host on OTN). 4. Modified the source code to adapt to the Lucene 7 API. Of note is that I now use TextField for all Field objects that were formerly created with Field.Index.ANALYZED, and StringField for those created with either Field.Index.NOT_ANALYZED or Field.Index.NOT_ANALYZED_NO_NORMS. StringField is equivalent to Field.Index.NOT_ANALYZED_NO_NORMS, which is a close enough approximation for both types of non-analyzed (non-tokenized) fields. 5. Regenerated all of the index files (the index files generated with Lucene 3 are incompatible) as follows: cd rt/apps/samples/Ensemble8 rm -rf src/generated/resources/ensemble/search/index ant -Dplatforms.JDK_1.9.home=$JAVA_HOME clean ensemble-generate-search-index jar rm src/generated/resources/ensemble/search/index/write.lock hg addremove src/generated/resources/ensemble/search/index
22-11-2017