• Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6, Trunk
    • Component/s: None
    • Labels:
    • Lucene Fields:


      Expressions are geared at defining an alternative ranking function (e.g. incorporating the text relevance score and other field values/ranking
      signals). So they are conceptually much more like ElasticSearch's scripting support ( than solr's function queries.

      Some additional notes:

      • In addition to referring to other fields, they can also refer to other expressions, so they can be used as "computed fields".
      • You can rank documents easily by multiple expressions (its a SortField at the end), e.g. Sort by year descending, then some function of score price and time ascending.
      • The provided javascript expression syntax is much more efficient than using a scripting engine, because it does not have dynamic typing (compiles to .class files that work on doubles). Performance is similar to writing a custom FieldComparator yourself, but much easier to do.
      • We have solr integration to contribute in the future, but this is just the standalone lucene part as a start. Since lucene has no schema, it includes an implementation of Bindings (SimpleBindings) that maps variable names to SortField's or other expressions.
      1. LUCENE-5207.patch
        165 kB
        Robert Muir
      2. LUCENE-5207.patch
        163 kB
        Robert Muir
      3. LUCENE-5207.patch
        270 kB
        Ryan Ernst


        Ryan Ernst created issue -
        Ryan Ernst made changes -
        Field Original Value New Value
        Attachment LUCENE-5207.patch [ 12602907 ]
        Robert Muir made changes -
        Attachment LUCENE-5207.patch [ 12603218 ]
        Robert Muir made changes -
        Attachment LUCENE-5207.patch [ 12603240 ]
        Robert Muir made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0 [ 12321663 ]
        Fix Version/s 4.6 [ 12324999 ]
        Resolution Fixed [ 1 ]


          • Assignee:
            Ryan Ernst
          • Votes:
            1 Vote for this issue
            10 Start watching this issue


            • Created: