Lucene - Core
  1. Lucene - Core
  2. LUCENE-3343

Comparison operators >,>=,<,<= and = support as RangeQuery syntax in QueryParser

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0
    • Component/s: modules/queryparser
    • Labels:
    • Lucene Fields:
      New, Patch Available

      Description

      To offer better interoperability with other search engines and to provide an easier and more straight forward syntax,
      the operators >, >=, <, <= and = should be available to express an open range query.
      They should at least work for numeric queries.
      '=' can be made a synonym for ':'.

      1. NumCompQueryParser-3x.patch
        92 kB
        Olivier Favre
      2. NumCompQueryParser.patch
        53 kB
        Olivier Favre

        Issue Links

          Activity

          Olivier Favre created issue -
          Hide
          Olivier Favre added a comment -

          The patch, including regenerated files by javacc.
          Tests ran successfully for queryparser.
          New tests created for the new feature.

          Show
          Olivier Favre added a comment - The patch, including regenerated files by javacc. Tests ran successfully for queryparser. New tests created for the new feature.
          Olivier Favre made changes -
          Field Original Value New Value
          Attachment NumCompQueryParser.patch [ 12487828 ]
          Olivier Favre made changes -
          Link This issue relates to LUCENE-1823 [ LUCENE-1823 ]
          Olivier Favre made changes -
          Fix Version/s 3.4 [ 12316675 ]
          Hide
          Olivier Favre added a comment -

          The patch for the lucene-3x branch, including regenerated files by javacc.
          Tests ran successfully for queryparser (core and contrib).
          Tests added created for the new feature.

          QueryParser (core) AND StandardQueryParser (contrib) have been modified.

          Show
          Olivier Favre added a comment - The patch for the lucene-3x branch, including regenerated files by javacc. Tests ran successfully for queryparser (core and contrib). Tests added created for the new feature. QueryParser (core) AND StandardQueryParser (contrib) have been modified.
          Olivier Favre made changes -
          Attachment NumCompQueryParser-3x.patch [ 12487986 ]
          Hide
          Adriano Crestani added a comment -

          Hi Oliver,

          Thanks for contributing the patch.

          It works perfectly, except for non-numeric queries. I fixed the problem by merging your patch with LUCENE-3338 (a patch with the new changes is attached there as well).

          I will take a look at your patch for 3x later.

          Show
          Adriano Crestani added a comment - Hi Oliver, Thanks for contributing the patch. It works perfectly, except for non-numeric queries. I fixed the problem by merging your patch with LUCENE-3338 (a patch with the new changes is attached there as well). I will take a look at your patch for 3x later.
          Adriano Crestani made changes -
          Assignee Adriano Crestani [ adriano_crestani ]
          Adriano Crestani made changes -
          Link This issue depends on LUCENE-3338 [ LUCENE-3338 ]
          adrianocrestani committed 1152892 (27 files)
          Reviews: none

          -committing patch from LUCENE-3343 and LUCENE-3338 to trunk
          -fixed javadoc reference to QueryNode in StandardSyntaxParser.jj

          Lucene trunk
          Hide
          Adriano Crestani added a comment -

          The code for 4.0 was just committed to the repository (rev 1152892)

          Show
          Adriano Crestani added a comment - The code for 4.0 was just committed to the repository (rev 1152892)
          Hide
          Olivier Favre added a comment -

          Great, thanks!
          No blockers for 3x?

          Show
          Olivier Favre added a comment - Great, thanks! No blockers for 3x?
          Hide
          Adriano Crestani added a comment -

          Hi Oliver,

          I was only able to make your patch work when I merged with LUCENE-3338, however LUCENE-3338 is only available for trunk, not 3x. I will need to figure out some other way to make it work on 3x. I plan to work on this soon, probably next weekend.

          Show
          Adriano Crestani added a comment - Hi Oliver, I was only able to make your patch work when I merged with LUCENE-3338 , however LUCENE-3338 is only available for trunk, not 3x. I will need to figure out some other way to make it work on 3x. I plan to work on this soon, probably next weekend.
          Michael McCandless made changes -
          Fix Version/s 3.5 [ 12317877 ]
          Fix Version/s 3.4 [ 12316675 ]
          Hide
          Simon Willnauer added a comment -

          Adirano, any plans to work on this any time soon?

          Show
          Simon Willnauer added a comment - Adirano, any plans to work on this any time soon?
          Simon Willnauer made changes -
          Fix Version/s 3.6 [ 12319070 ]
          Fix Version/s 3.5 [ 12317877 ]
          Hide
          Ingo Renner added a comment -

          I'd also like to have this for 3.x, would be a great feature!

          Show
          Ingo Renner added a comment - I'd also like to have this for 3.x, would be a great feature!
          Hide
          Robert Muir added a comment -

          This does look like an interesting feature, but it seems there might be some work for 3.x,
          can we defer this to 4.0?

          Show
          Robert Muir added a comment - This does look like an interesting feature, but it seems there might be some work for 3.x, can we defer this to 4.0?
          Hide
          Adriano Crestani added a comment -

          Hi, sorry, I really didn't have much time to work on this lately.

          But that's true, we still need to figure out how to apply the patch against 3.x, there are some extra work to do to make it work with 3.x. I remember I applied the patch and some junits were failing.

          The patch is already applied to 4.0.

          Show
          Adriano Crestani added a comment - Hi, sorry, I really didn't have much time to work on this lately. But that's true, we still need to figure out how to apply the patch against 3.x, there are some extra work to do to make it work with 3.x. I remember I applied the patch and some junits were failing. The patch is already applied to 4.0.
          Hide
          Hoss Man added a comment -

          bumping from 3.6 since it sounds like Adriano isn't actively working on it

          Show
          Hoss Man added a comment - bumping from 3.6 since it sounds like Adriano isn't actively working on it
          Hoss Man made changes -
          Fix Version/s 3.6 [ 12319070 ]
          Robert Muir made changes -
          Fix Version/s 4.1 [ 12321140 ]
          Fix Version/s 4.0 [ 12314025 ]
          Hide
          Otis Gospodnetic added a comment -

          I have a feeling this should just be marked as Fixed, as it doesn't look like this will be back ported to 3.x.

          Show
          Otis Gospodnetic added a comment - I have a feeling this should just be marked as Fixed, as it doesn't look like this will be back ported to 3.x.
          Hide
          Ingo Renner added a comment -

          if it's in 4.1 as stated, that seems fine.

          Show
          Ingo Renner added a comment - if it's in 4.1 as stated, that seems fine.
          Hide
          Jack Krupansky added a comment -

          To avoid confusion, it should be explicitly noted that this change applies only to the Lucene "flexible" query parser, and NOT to the "classic" Lucene query parser and hence not to any of the Solr plugin query parsers that are derived from the classic Lucene query parser. Maybe the title should say "Flexible QueryParser".

          Show
          Jack Krupansky added a comment - To avoid confusion, it should be explicitly noted that this change applies only to the Lucene "flexible" query parser, and NOT to the "classic" Lucene query parser and hence not to any of the Solr plugin query parsers that are derived from the classic Lucene query parser. Maybe the title should say "Flexible QueryParser".
          Hide
          Yonik Seeley added a comment -

          There was always a lot of talk in the past of deprecating / removing the old/classic lucene query parser.
          I always objected to that in the past due to Solr's use of the parser, but now that solr has it's own, it may make sense to revisit that.

          Show
          Yonik Seeley added a comment - There was always a lot of talk in the past of deprecating / removing the old/classic lucene query parser. I always objected to that in the past due to Solr's use of the parser, but now that solr has it's own, it may make sense to revisit that.
          Hide
          Jack Krupansky added a comment -

          And that begs the question of whether Solr itself should consider moving over to the flexible query parser. Is there a Jira for that (since that's where this discussion should go)?

          Show
          Jack Krupansky added a comment - And that begs the question of whether Solr itself should consider moving over to the flexible query parser. Is there a Jira for that (since that's where this discussion should go)?
          Hide
          Steve Rowe added a comment -

          Resolving as fixed.

          This was committed to 4.0, and had remained open in order to backport to 3.6, but because this is a new feature, and the 3.6 branch is open only for bugfixes, it will never be released in any 3.6.X version.

          Show
          Steve Rowe added a comment - Resolving as fixed. This was committed to 4.0, and had remained open in order to backport to 3.6, but because this is a new feature, and the 3.6 branch is open only for bugfixes, it will never be released in any 3.6.X version.
          Steve Rowe made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 4.0 [ 12322550 ]
          Fix Version/s 4.1 [ 12321140 ]
          Resolution Fixed [ 1 ]
          Gavin made changes -
          Link This issue depends on LUCENE-3338 [ LUCENE-3338 ]
          Gavin made changes -
          Link This issue depends upon LUCENE-3338 [ LUCENE-3338 ]
          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.
          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Adriano Crestani
              Reporter:
              Olivier Favre
            • Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 96h
                96h
                Remaining:
                Remaining Estimate - 96h
                96h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development