Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9, 6.0
    • Component/s: modules/expressions
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      The current expressions modules only allows ASCII letters, ASCII digits and the underscore in variable names.

      It is quite common to javascript developers to use also the dollar sign as identifier part (especially at the beginning of an identifier, see the famous "jQuery" $-function). This would allow bindings like "$score".

      The official ECMAScript spec allows the $: http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf (see section 7.6)

      The other stuff there like unicode escapes and all unicode letter crazyness should be excluded for simplicity.

      Adding the "$" is just a one-line change in the grammar and does not conflict with anything else, because "$" is not a special character to javascript.

      1. LUCENE-5754.patch
        5 kB
        Uwe Schindler
      2. LUCENE-5754.patch
        5 kB
        Uwe Schindler

        Issue Links

          Activity

          Hide
          Uwe Schindler added a comment -

          Patch. This is more or less only a change in grammar + "ant regenerate".

          I also added a simple test, which uses "$0" as the score binding.

          Show
          Uwe Schindler added a comment - Patch. This is more or less only a change in grammar + "ant regenerate". I also added a simple test, which uses "$0" as the score binding.
          Hide
          Ryan Ernst added a comment -

          +1

          Show
          Ryan Ernst added a comment - +1
          Hide
          Uwe Schindler added a comment -

          Final patch with slightly improved patch to check parser compatibility. Will commit now.

          Show
          Uwe Schindler added a comment - Final patch with slightly improved patch to check parser compatibility. Will commit now.
          Hide
          ASF subversion and git services added a comment -

          Commit 1602344 from Uwe Schindler in branch 'dev/trunk'
          [ https://svn.apache.org/r1602344 ]

          LUCENE-5754: Allow "$" as part of variable and function names in expressions module

          Show
          ASF subversion and git services added a comment - Commit 1602344 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1602344 ] LUCENE-5754 : Allow "$" as part of variable and function names in expressions module
          Hide
          ASF subversion and git services added a comment -

          Commit 1602345 from Uwe Schindler in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1602345 ]

          Merged revision(s) 1602344 from lucene/dev/trunk:
          LUCENE-5754: Allow "$" as part of variable and function names in expressions module

          Show
          ASF subversion and git services added a comment - Commit 1602345 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1602345 ] Merged revision(s) 1602344 from lucene/dev/trunk: LUCENE-5754 : Allow "$" as part of variable and function names in expressions module

            People

            • Assignee:
              Uwe Schindler
              Reporter:
              Uwe Schindler
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development