Lucene - Core
  1. Lucene - Core
  2. LUCENE-5334

Add Namespaces to Expressions Javascript Compiler

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      I would like to add the concept of namespaces to the expressions javascript compiler using '.' as the operator.

      Example of namespace usage in functions:
      AccurateMath.sqrt(field)
      FastMath.sqrt(field)

      Example of namespace usage in variables:
      location.latitude
      location.longitude

      1. LUCENE-5334.patch
        55 kB
        Jack Conradson

        Activity

        Hide
        Jack Conradson added a comment -

        Attached a patch with unit tests. Note that a large portion of the patch is the regenerated ANTLR lexer/parser.

        Show
        Jack Conradson added a comment - Attached a patch with unit tests. Note that a large portion of the patch is the regenerated ANTLR lexer/parser.
        Hide
        Robert Muir added a comment -

        +1

        Show
        Robert Muir added a comment - +1
        Hide
        Uwe Schindler added a comment -

        Hi,
        I don't understand what the antlr source code is doing, but the other changes look fine.
        Uwe

        Show
        Uwe Schindler added a comment - Hi, I don't understand what the antlr source code is doing, but the other changes look fine. Uwe
        Hide
        Jack Conradson added a comment -

        Hi Uwe,

        Thanks for taking a look. Unfortunately, for even small changes within the ANTLR grammar, a large number of differences will be created for the ANTLR generated lexer/parser code. With the assumption that ANTLR has correctly generated the lexer/parser code from the grammar, it should be fine. The unit tests seem to have pretty good coverage, so I think it should be good to go .

        --Jack

        Show
        Jack Conradson added a comment - Hi Uwe, Thanks for taking a look. Unfortunately, for even small changes within the ANTLR grammar, a large number of differences will be created for the ANTLR generated lexer/parser code. With the assumption that ANTLR has correctly generated the lexer/parser code from the grammar, it should be fine. The unit tests seem to have pretty good coverage, so I think it should be good to go . --Jack
        Hide
        ASF subversion and git services added a comment -

        Commit 1540195 from Ryan Ernst in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1540195 ]

        LUCENE-5334: Add Namespaces to Expressions Javascript Compiler

        Show
        ASF subversion and git services added a comment - Commit 1540195 from Ryan Ernst in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1540195 ] LUCENE-5334 : Add Namespaces to Expressions Javascript Compiler
        Hide
        Ryan Ernst added a comment -

        Thanks Jack!

        Show
        Ryan Ernst added a comment - Thanks Jack!
        Hide
        Jack Conradson added a comment -

        Thanks for committing, Ryan.

        Show
        Jack Conradson added a comment - Thanks for committing, Ryan.

          People

          • Assignee:
            Ryan Ernst
            Reporter:
            Jack Conradson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development