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

NumericRange support for new query parser



    • New


      It would be good to specify some type of "schema" for the query parser in future, to automatically create NumericRangeQuery for different numeric types? It would then be possible to index a numeric value (double,float,long,int) using NumericField and then the query parser knows, which type of field this is and so it correctly creates a NumericRangeQuery for strings like "[1.567..*]" or "(1.787..19.5]".

      There is currently no way to extract if a field is numeric from the index, so the user will have to configure the FieldConfig objects in the ConfigHandler. But if this is done, it will not be that difficult to implement the rest.

      The only difference between the current handling of RangeQuery is then the instantiation of the correct Query type and conversion of the entered numeric values (simple Number.valueOf(...) cast of the user entered numbers). Evenerything else is identical, NumericRangeQuery also supports the MTQ rewrite modes (as it is a MTQ).

      Another thing is a change in Date semantics. There are some strange flags in the current parser that tells it how to handle dates.


        1. week1.patch
          24 kB
          Vinicius Barros
        2. week2.patch
          39 kB
          Vinicius Barros
        3. week3.patch
          76 kB
          Vinicius Barros
        4. week4.patch
          82 kB
          Vinicius Barros
        5. week5-6.patch
          108 kB
          Vinicius Barros
        6. week-7.patch
          97 kB
          Vinicius Barros
        7. TestNumericQueryParser-fix.patch
          6 kB
          Vinicius Barros
        8. TestNumericQueryParser-fix.patch
          8 kB
          Uwe Schindler
        9. TestNumericQueryParser-fix.patch
          9 kB
          Uwe Schindler
        10. TestNumericQueryParser-fix.patch
          10 kB
          Uwe Schindler
        11. week-8.patch
          29 kB
          Vinicius Barros
        12. week11-13_for_lucene_3x.patch
          102 kB
          Vinicius Barros
        13. week11-13_for_lucene_3x.patch
          108 kB
          Uwe Schindler
        14. week-14.patch
          61 kB
          Vinicius Barros
        15. week15_for_trunk.patch
          61 kB
          Vinicius Barros
        16. week15_for_lucene_3x.patch
          2 kB
          Vinicius Barros

        Issue Links



              uschindler Uwe Schindler
              uschindler Uwe Schindler
              0 Vote for this issue
              4 Start watching this issue