Lucene - Core
  1. Lucene - Core
  2. LUCENE-4103

AnalyzerQueryNodeProcessor throws a class cast exception with the RegexpQueryNode

    Details

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

      Description

      When using the flexible query parser with the regular expression syntax the processing pipeline fails with the following class cast exception:

      java.lang.ClassCastException: org.apache.lucene.queryparser.flexible.standard.nodes.RegexpQueryNode cannot be cast to org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode
      	at __randomizedtesting.SeedInfo.seed([34AF003D9388DF45:CB5F8BB4EE483FEE]:0)
      	at org.apache.lucene.queryparser.flexible.standard.processors.AnalyzerQueryNodeProcessor.postProcessNode(AnalyzerQueryNodeProcessor.java:114)
      

      A very simple patch is attached that will simply add the RegexpQueryNode to the nodes that should not get processed by the AnalyzerQueryNodeProcessor. I think this means that the regular expression is not analyzed, which should be ok!?

      1. 0001-Fix-for-the-flexible-regexp-parsing.patch
        6 kB
        Daniel Truemper
      2. LUCENE-4103.patch
        3 kB
        Daniel Truemper

        Activity

        Hide
        Daniel Truemper added a comment -

        A patch in GIT format that can be applied to SVN via `patch -p1 -i 0001-F...`

        Show
        Daniel Truemper added a comment - A patch in GIT format that can be applied to SVN via `patch -p1 -i 0001-F...`
        Hide
        Daniel Truemper added a comment -

        More sane test case in the TestQPHelper

        Show
        Daniel Truemper added a comment - More sane test case in the TestQPHelper
        Hide
        Robert Muir added a comment -

        Thanks Daniel!

        Show
        Robert Muir added a comment - Thanks Daniel!

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel Truemper
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development