Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5754

Allow "$" in expression variables

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: 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.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              uschindler Uwe Schindler
              Reporter:
              uschindler Uwe Schindler

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment