Solr
  1. Solr
  2. SOLR-7978

Really fix the example/files update-script Java version issues

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3.1, 6.0
    • Component/s: examples
    • Labels:
      None

      Description

      SOLR-7652 addressed this issue by having a Java7 version of the script for 5x and a Java8 version on trunk. 5x on Java8 is broken though. I wager that there's got to be some incantations that can make the same script work on Java 7 and 8.

      1. SOLR-7978.patch
        4 kB
        Erik Hatcher

        Activity

        Hide
        Erik Hatcher added a comment -

        Here's a test case patch that works in both Java7 and Java8 (via IntelliJ, alternating project JVM settings and running the test case). Since Jenkins runs 5x in both Java7 and Java8 this should be a good test.

        I'll fold this technique into example/files update-script.js.

        Show
        Erik Hatcher added a comment - Here's a test case patch that works in both Java7 and Java8 (via IntelliJ, alternating project JVM settings and running the test case). Since Jenkins runs 5x in both Java7 and Java8 this should be a good test. I'll fold this technique into example/files update-script.js.
        Hide
        Uwe Schindler added a comment -
        analyzer.tokenStream("subject", new java.io.StringReader(doc.getFieldValue("subject")))
        

        Since long time, Analyzer also takes String, so no need for StringReader. This is also faster (doesn't matter in JS, of course): http://lucene.apache.org/core/5_3_0/core/org/apache/lucene/analysis/Analyzer.html#tokenStream(java.lang.String,%20java.lang.String)

        Show
        Uwe Schindler added a comment - analyzer.tokenStream("subject", new java.io.StringReader(doc.getFieldValue("subject"))) Since long time, Analyzer also takes String , so no need for StringReader . This is also faster (doesn't matter in JS, of course): http://lucene.apache.org/core/5_3_0/core/org/apache/lucene/analysis/Analyzer.html#tokenStream(java.lang.String,%20java.lang.String)
        Hide
        ASF subversion and git services added a comment -

        Commit 1701883 from Erik Hatcher in branch 'dev/trunk'
        [ https://svn.apache.org/r1701883 ]

        SOLR-7978: Fixed example/files update-script.js to be Java 7 and 8 compatible

        Show
        ASF subversion and git services added a comment - Commit 1701883 from Erik Hatcher in branch 'dev/trunk' [ https://svn.apache.org/r1701883 ] SOLR-7978 : Fixed example/files update-script.js to be Java 7 and 8 compatible
        Hide
        ASF subversion and git services added a comment -

        Commit 1701884 from Erik Hatcher in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1701884 ]

        SOLR-7978: Fixed example/files update-script.js to be Java 7 and 8 compatible (merged from trunk r1701883)

        Show
        ASF subversion and git services added a comment - Commit 1701884 from Erik Hatcher in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1701884 ] SOLR-7978 : Fixed example/files update-script.js to be Java 7 and 8 compatible (merged from trunk r1701883)
        Hide
        ASF subversion and git services added a comment -

        Commit 1701886 from Erik Hatcher in branch 'dev/branches/lucene_solr_5_3'
        [ https://svn.apache.org/r1701886 ]

        SOLR-7972, SOLR-7929, SOLR-7978: merge fixes to 5.3 branch for 5.3.1 release

        Show
        ASF subversion and git services added a comment - Commit 1701886 from Erik Hatcher in branch 'dev/branches/lucene_solr_5_3' [ https://svn.apache.org/r1701886 ] SOLR-7972 , SOLR-7929 , SOLR-7978 : merge fixes to 5.3 branch for 5.3.1 release

          People

          • Assignee:
            Erik Hatcher
            Reporter:
            Erik Hatcher
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development