Lucene - Core
  1. Lucene - Core
  2. LUCENE-6857

Validate StandardQueryParser with NOT operator with-in parentheses.

    Details

    • Type: Test Test
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 4.10.5, 5.4, 6.0
    • Component/s: core/queryparser
    • Labels:
      None
    • Lucene Fields:
      New
    • Flags:
      Patch

      Description

      Provide test case to validate LUCENE-6249, which validates NOT in parentheses.

      e.g:
      lottery (NOT ticket)
      lottery (-ticket)

      lottery AND (NOT ticket)
      +lottery +(-ticket)

        Issue Links

          Activity

          Hide
          Dawid Weiss added a comment -

          Can you provide a patch (test for this) too, Jigar? Thanks!

          Show
          Dawid Weiss added a comment - Can you provide a patch (test for this) too, Jigar? Thanks!
          Hide
          Jigar Shah added a comment -

          Working on it, will provide it soon.

          Show
          Jigar Shah added a comment - Working on it, will provide it soon.
          Hide
          Jigar Shah added a comment -

          Test cases for NOT in parentheses.

          Show
          Jigar Shah added a comment - Test cases for NOT in parentheses.
          Hide
          Jigar Shah added a comment - - edited

          Following issue still remains in 4.10.3 release. LUCENE-6249 fixes following issue from 5.1.

          Original issue description:
          --------------------------------------------------------
          Thanks for your reply Erick,
          I have gone through the document provided by you.
          However what I have observed is that there is difference if we parse query with Lucene 4.10.3 and Lucene 5.2.0 onwards.
          For example :Query String: lottery AND (NOT ticket)Lucene 4.x parsed it as: +lottery +ticket
          Lucene 5.1.x parsed it as: +lottery +(-ticket)
          And I want result as 5.1.x produces. But as I am not planning to upgrade lucene now so looking for fix for lucene 4.10.x.
          Please could you help on this?
          Thanks,Mrugesh
          -------------------------------------------------------

          Provided patch for test case.

          Added testcases to validate LUCENE-6249

          Show
          Jigar Shah added a comment - - edited Following issue still remains in 4.10.3 release. LUCENE-6249 fixes following issue from 5.1. Original issue description: -------------------------------------------------------- Thanks for your reply Erick, I have gone through the document provided by you. However what I have observed is that there is difference if we parse query with Lucene 4.10.3 and Lucene 5.2.0 onwards. For example :Query String: lottery AND (NOT ticket)Lucene 4.x parsed it as: +lottery +ticket Lucene 5.1.x parsed it as: +lottery +(-ticket) And I want result as 5.1.x produces. But as I am not planning to upgrade lucene now so looking for fix for lucene 4.10.x. Please could you help on this? Thanks,Mrugesh ------------------------------------------------------- Provided patch for test case. Added testcases to validate LUCENE-6249
          Hide
          Dawid Weiss added a comment -

          I'll review later today (mark as fixed when committed, Jigar).

          Show
          Dawid Weiss added a comment - I'll review later today (mark as fixed when committed, Jigar).
          Hide
          Jigar Shah added a comment -

          Sorry, for putting directly to resolved state. Will wait for your response.

          Thanks

          Show
          Jigar Shah added a comment - Sorry, for putting directly to resolved state. Will wait for your response. Thanks
          Hide
          Dawid Weiss added a comment -

          Looks good, but I think there are tabs in your patch – the accepted source convention is 2 spaces per indent, no tabs. I will correct it when committing, but remember about it in the future, thanks!

          Show
          Dawid Weiss added a comment - Looks good, but I think there are tabs in your patch – the accepted source convention is 2 spaces per indent, no tabs. I will correct it when committing, but remember about it in the future, thanks!
          Hide
          ASF subversion and git services added a comment -

          Commit 1710970 from Dawid Weiss in branch 'dev/trunk'
          [ https://svn.apache.org/r1710970 ]

          LUCENE-6857: Validate StandardQueryParser with NOT operator with-in parantheses

          Show
          ASF subversion and git services added a comment - Commit 1710970 from Dawid Weiss in branch 'dev/trunk' [ https://svn.apache.org/r1710970 ] LUCENE-6857 : Validate StandardQueryParser with NOT operator with-in parantheses
          Hide
          Jigar Shah added a comment -

          Thanks for accepting patch. Will remember formatting tips, for future patches.

          Show
          Jigar Shah added a comment - Thanks for accepting patch. Will remember formatting tips, for future patches.
          Hide
          ASF subversion and git services added a comment -

          Commit 1710971 from Dawid Weiss in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1710971 ]

          LUCENE-6857: Validate StandardQueryParser with NOT operator with-in parantheses.

          Show
          ASF subversion and git services added a comment - Commit 1710971 from Dawid Weiss in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1710971 ] LUCENE-6857 : Validate StandardQueryParser with NOT operator with-in parantheses.
          Hide
          ASF subversion and git services added a comment -

          Commit 1711037 from Dawid Weiss in branch 'dev/branches/lucene_solr_4_10'
          [ https://svn.apache.org/r1711037 ]

          LUCENE-6857: Validate StandardQueryParser with NOT operator with-in parentheses.

          Show
          ASF subversion and git services added a comment - Commit 1711037 from Dawid Weiss in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1711037 ] LUCENE-6857 : Validate StandardQueryParser with NOT operator with-in parentheses.

            People

            • Assignee:
              Dawid Weiss
              Reporter:
              Jigar Shah
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development