Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9
    • Component/s: modules/other
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      We should rename the new QueryParser so it's clearer that it's
      Lucene's default QueryParser, going forward, and not just a temporary
      "bridge" to a future new QueryParser.

      How about we rename oal.queryParser.original -->
      oal.queryParser.standard (can't use "default": it's a Java keyword)?
      Then, leave the OriginalQueryParserHelper under that package, but
      simply rename it to QueryParser?

      This way if we create other sub-packages in the future, eg
      ComplexPhraseQueryParser, they too can have a QueryParser class under
      them, to make it clear that's the "top" class you use to parse
      queries.

      1. LUCENE-1782.patch
        823 kB
        Michael McCandless
      2. LUCENE-1782.patch
        848 kB
        Michael McCandless

        Issue Links

          Activity

          Hide
          Adriano Crestani added a comment -

          I really liked the idea Mike!

          If QueryParser is under "standard", so it's the standard QueryParser. Makes sense, so, I would like to suggest to do the same for:

          -OriginalBooleanQueryNodeBuilder
          -OriginalQueryBuilder
          -OriginalBooleanQueryTreeBuilder
          -OriginalQueryConfigHandler
          -OriginalBooleanQueryNode
          -OriginalSyntaxParser (and all the other classes generated by JavaCC)
          -OriginalQueryNodeProcessorPipeline

          And you are right, "default" cannot be used for a package name, I just double checked that. I think "standard" is fine too

          Show
          Adriano Crestani added a comment - I really liked the idea Mike! If QueryParser is under "standard", so it's the standard QueryParser. Makes sense, so, I would like to suggest to do the same for: -OriginalBooleanQueryNodeBuilder -OriginalQueryBuilder -OriginalBooleanQueryTreeBuilder -OriginalQueryConfigHandler -OriginalBooleanQueryNode -OriginalSyntaxParser (and all the other classes generated by JavaCC) -OriginalQueryNodeProcessorPipeline And you are right, "default" cannot be used for a package name, I just double checked that. I think "standard" is fine too
          Hide
          Michael McCandless added a comment -

          OK I'll work up a patch, renaming original -> standard, and I'll fix all the various support classes to remove their Original prefix.

          Show
          Michael McCandless added a comment - OK I'll work up a patch, renaming original -> standard, and I'll fix all the various support classes to remove their Original prefix.
          Hide
          Michael Busch added a comment -

          Thanks, Mike. This sounds good.

          Show
          Michael Busch added a comment - Thanks, Mike. This sounds good.
          Hide
          Michael McCandless added a comment -

          OK I have a huge patch working, but then I went to run JavaCC to regenerate the parser to make sure I've fixed the .jj file correctly, and there wasn't a javacc target in the build.xml. So I added one (in build.xml) and ran javacc and got warnings like this:

          Warning: ParseException.java: File is obsolete.  Please rename or delete this file so that a new one can be generated for you.
          

          So I removed ParseException.java and let JavaCC make a new one, but then hit compilation errors because the old ParseException.java manually subclassed from QueryNodeParseException (which is nice). So I simply copied the old one back... is this expected? Ie there's no way to customize how JavaCC generates its ParseException.java, so we manually override it? If so, I'll add comment to build.xml saying so.

          Show
          Michael McCandless added a comment - OK I have a huge patch working, but then I went to run JavaCC to regenerate the parser to make sure I've fixed the .jj file correctly, and there wasn't a javacc target in the build.xml. So I added one (in build.xml) and ran javacc and got warnings like this: Warning: ParseException.java: File is obsolete. Please rename or delete this file so that a new one can be generated for you. So I removed ParseException.java and let JavaCC make a new one, but then hit compilation errors because the old ParseException.java manually subclassed from QueryNodeParseException (which is nice). So I simply copied the old one back... is this expected? Ie there's no way to customize how JavaCC generates its ParseException.java, so we manually override it? If so, I'll add comment to build.xml saying so.
          Hide
          Adriano Crestani added a comment -

          Hi Mike,

          I think ParseException is the only file we actually need to manually modify after its generation. I think the only manual change you are required to do is to extend QueryNodeParseException.

          Give it a try and let me know if it worked.

          Show
          Adriano Crestani added a comment - Hi Mike, I think ParseException is the only file we actually need to manually modify after its generation. I think the only manual change you are required to do is to extend QueryNodeParseException. Give it a try and let me know if it worked.
          Hide
          Michael McCandless added a comment -

          Give it a try and let me know if it worked.

          Looks like we also make mods to it to accept MessageImpl:

              [javac] Compiling 133 source files to /lucene/tmp.1782/build/contrib/queryparser/classes/java
              [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/SyntaxParser.java:465: cannot find symbol
              [javac] symbol  : constructor ParseException(org.apache.lucene.messages.MessageImpl)
              [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException
              [javac]            {if (true) throw new ParseException(new MessageImpl(QueryParserMessages.INVALID_SYNTAX_FUZZY_LIMITS));}
              [javac]                             ^
              [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java:34: cannot find symbol
              [javac] symbol  : constructor QueryNodeParseException(java.lang.String)
              [javac] location: class org.apache.lucene.queryParser.core.QueryNodeParseException
              [javac]     super("");
              [javac]     ^
              [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java:52: cannot find symbol
              [javac] symbol  : constructor QueryNodeParseException()
              [javac] location: class org.apache.lucene.queryParser.core.QueryNodeParseException
              [javac]     super();
              [javac]     ^
              [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java:58: cannot find symbol
              [javac] symbol  : constructor QueryNodeParseException(java.lang.String)
              [javac] location: class org.apache.lucene.queryParser.core.QueryNodeParseException
              [javac]     super(message);
              [javac]     ^
              [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java:270: cannot find symbol
              [javac] symbol  : constructor ParseException(org.apache.lucene.messages.MessageImpl)
              [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException
              [javac]       throw new ParseException(new MessageImpl(
              [javac]             ^
              [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java:275: cannot find symbol
              [javac] symbol  : constructor ParseException(org.apache.lucene.messages.MessageImpl)
              [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException
              [javac]       throw new ParseException(new MessageImpl(
              [javac]             ^
              [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java:291: cannot find symbol
              [javac] symbol  : constructor ParseException(org.apache.lucene.messages.MessageImpl)
              [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException
              [javac]       throw new ParseException(new MessageImpl(
              [javac]             ^
          
          Show
          Michael McCandless added a comment - Give it a try and let me know if it worked. Looks like we also make mods to it to accept MessageImpl: [javac] Compiling 133 source files to /lucene/tmp.1782/build/contrib/queryparser/classes/java [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/SyntaxParser.java:465: cannot find symbol [javac] symbol : constructor ParseException(org.apache.lucene.messages.MessageImpl) [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException [javac] { if ( true ) throw new ParseException( new MessageImpl(QueryParserMessages.INVALID_SYNTAX_FUZZY_LIMITS));} [javac] ^ [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java:34: cannot find symbol [javac] symbol : constructor QueryNodeParseException(java.lang. String ) [javac] location: class org.apache.lucene.queryParser.core.QueryNodeParseException [javac] super (""); [javac] ^ [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java:52: cannot find symbol [javac] symbol : constructor QueryNodeParseException() [javac] location: class org.apache.lucene.queryParser.core.QueryNodeParseException [javac] super (); [javac] ^ [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java:58: cannot find symbol [javac] symbol : constructor QueryNodeParseException(java.lang. String ) [javac] location: class org.apache.lucene.queryParser.core.QueryNodeParseException [javac] super (message); [javac] ^ [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java:270: cannot find symbol [javac] symbol : constructor ParseException(org.apache.lucene.messages.MessageImpl) [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException [javac] throw new ParseException( new MessageImpl( [javac] ^ [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java:275: cannot find symbol [javac] symbol : constructor ParseException(org.apache.lucene.messages.MessageImpl) [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException [javac] throw new ParseException( new MessageImpl( [javac] ^ [javac] /lucene/tmp.1782/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java:291: cannot find symbol [javac] symbol : constructor ParseException(org.apache.lucene.messages.MessageImpl) [javac] location: class org.apache.lucene.queryParser.standard.parser.ParseException [javac] throw new ParseException( new MessageImpl( [javac] ^
          Hide
          Michael McCandless added a comment -

          Attached enormous patch.

          It's much simpler than it looks... I used "svn move" to shuffle
          everything around, replaced "original" with "standard" everywhere,
          renamed StandardQueryParserHelper to simply QueryParser, and stripped
          Standard prefix off a bunch of classes. I also had to fix a handful
          of places that dealt with both the core & standard versions of the
          same class, by fully qualifying the core one.

          One class (StandardBooleanQueryNodeBuilder) had to keep its Standard
          prefix because BooleanQueryNodeBuilder was also in the same package.

          The patch also add the "javacc" target to build.xml, and a comment
          explaining about ParseException.java.

          Show
          Michael McCandless added a comment - Attached enormous patch. It's much simpler than it looks... I used "svn move" to shuffle everything around, replaced "original" with "standard" everywhere, renamed StandardQueryParserHelper to simply QueryParser, and stripped Standard prefix off a bunch of classes. I also had to fix a handful of places that dealt with both the core & standard versions of the same class, by fully qualifying the core one. One class (StandardBooleanQueryNodeBuilder) had to keep its Standard prefix because BooleanQueryNodeBuilder was also in the same package. The patch also add the "javacc" target to build.xml, and a comment explaining about ParseException.java.
          Hide
          Adriano Crestani added a comment -

          Thanks Mike

          The patch also add the "javacc" target to build.xml, and a comment
          explaining about ParseException.java.

          I think there is a readme file where the .jj file is located that explains all necessary manual changes required. I will review this readme later to check if everything is up to date.

          Show
          Adriano Crestani added a comment - Thanks Mike The patch also add the "javacc" target to build.xml, and a comment explaining about ParseException.java. I think there is a readme file where the .jj file is located that explains all necessary manual changes required. I will review this readme later to check if everything is up to date.
          Hide
          Michael McCandless added a comment -

          I plan to commit this in the next day or so...

          Show
          Michael McCandless added a comment - I plan to commit this in the next day or so...
          Hide
          Luis Alves added a comment - - edited

          renamed StandardQueryParserHelper to simply QueryParser, and stripped
          Standard prefix off a bunch of classes.

          I don't like the idea of "stripped Standard prefix" or "StandardQueryParserHelper to simply QueryParser".

          My reason for this, is that this change will make it more difficult for users
          that want to use several implementations of diff parsers at same time.

          QueryParserHelper can be renamed to QueryParser,
          but the other classes should keep the prefix name to avoid name conflicts,
          when using multiple parsers.

          example (seudo java):
          
          oqp = new OriginaleQueryParser(); 
          cpqp = new ComplexPhraseQueryParser(); 
          
          q1 = oqp.parser("normal query");
          q2 = cpqp.parser("complex string");
          
          b = new BooleanQuery();
          
          b.add(q1);
          b.add(q2);
          
          Show
          Luis Alves added a comment - - edited renamed StandardQueryParserHelper to simply QueryParser, and stripped Standard prefix off a bunch of classes. I don't like the idea of "stripped Standard prefix" or "StandardQueryParserHelper to simply QueryParser". My reason for this, is that this change will make it more difficult for users that want to use several implementations of diff parsers at same time. QueryParserHelper can be renamed to QueryParser, but the other classes should keep the prefix name to avoid name conflicts, when using multiple parsers. example (seudo java): oqp = new OriginaleQueryParser(); cpqp = new ComplexPhraseQueryParser(); q1 = oqp.parser( "normal query" ); q2 = cpqp.parser( "complex string" ); b = new BooleanQuery(); b.add(q1); b.add(q2);
          Hide
          Luis Alves added a comment -

          I also want to point to everyone, that we should push for developers
          that want to have more control over the QueryParser, the use of SyntaxParser,
          Processors, Builders interfaces.

          The QueryParserHelper was supposed to be a basic class for basic usage.

          Anything that required extra tweaking of the QP should be done directly by
          calling the StandartSynxtaParser, StandartProcessorPipeline, StandartQueryTreeBuilder
          directly, or by creating new ones.

          If we expect the user to combine Processors, Builders, or syntaxParser implementations in the future,
          we should avoid having name overlap in this initial design.

          Show
          Luis Alves added a comment - I also want to point to everyone, that we should push for developers that want to have more control over the QueryParser, the use of SyntaxParser, Processors, Builders interfaces. The QueryParserHelper was supposed to be a basic class for basic usage. Anything that required extra tweaking of the QP should be done directly by calling the StandartSynxtaParser, StandartProcessorPipeline, StandartQueryTreeBuilder directly, or by creating new ones. If we expect the user to combine Processors, Builders, or syntaxParser implementations in the future, we should avoid having name overlap in this initial design.
          Hide
          Luis Alves added a comment - - edited

          Hi,

          I'm adding another example to try to describe the point of having unique names,
          to make it easier for future usage.

          Below is another (seudo java) example.
          The example uses 2 diferent SyntaxParser implementations,
          but only one ProcessorPipeline and one QueryTreeBuilder implementation
          to create a single lucene Query.

          String uiquery = "a AND b";
          
          SyntaxParser ssp = new StandartSyntaxParser()
          QueryNode tree = ssp.parse(uiquery);
          
          SyntaxParser xmlsp = new XMLSyntaxParser();
          QueryNode filter = xmlsp.parse("<query><name='area' code='408'/></query>");
          
          QueryNode bqn = new AndQueryNode();
          bqn.add(ssp);
          bqn.add(filter);
          
          QueryNodeProcessor spp = new StandartProcessorPipeline(config);
          
          QueryNode optimizedTree = spp.process(bqn);
          
          Query q = builder.build(optimizedTree);
          
          Show
          Luis Alves added a comment - - edited Hi, I'm adding another example to try to describe the point of having unique names, to make it easier for future usage. Below is another (seudo java) example. The example uses 2 diferent SyntaxParser implementations, but only one ProcessorPipeline and one QueryTreeBuilder implementation to create a single lucene Query. String uiquery = "a AND b" ; SyntaxParser ssp = new StandartSyntaxParser() QueryNode tree = ssp.parse(uiquery); SyntaxParser xmlsp = new XMLSyntaxParser(); QueryNode filter = xmlsp.parse( "<query><name='area' code='408'/></query>" ); QueryNode bqn = new AndQueryNode(); bqn.add(ssp); bqn.add(filter); QueryNodeProcessor spp = new StandartProcessorPipeline(config); QueryNode optimizedTree = spp.process(bqn); Query q = builder.build(optimizedTree);
          Hide
          Luis Alves added a comment - - edited

          To build the OriginalQueryParser.

          Delete

          • OriginalQueryParser.java
          • OriginalQueryParserConstants.java
          • OriginalQueryParserTokenManager.java
          • TokenMgrError.java
          • JavaCharStream.java
          • Token.java

          run JavaCC on QueryParser.jj. That will generate the all the classes

          Also, to avoid lots of warnings in the generated code:

          • add @SupressWarnings("all") to QueryParserTokenManager.java, tokenMgrError.java,
            JavaCharStream.java, Token.java and JavaCharStream.java
            immediately preceding the class declaration.
          • remove all imports from TokenMgrError.java
          • If you delete ParseException. You will need to edit the ParseException class to extend from QueryNodeParseException class
            "public class ParseException extends QueryNodeParseException".
            Recreate the all the constructors like this:
                public ParseException(Token currentTokenVal,
                  int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
                super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(
                    currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));
                this.currentToken = currentTokenVal;
                this.expectedTokenSequences = expectedTokenSequencesVal;
                this.tokenImage = tokenImageVal;
              }
            
              public ParseException(Message message) {
                super(message);
              }
            
              public ParseException() {
                super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
              }
            
          • fix all imports

          This needs to be done after each time these files are generated by javacc.

          Show
          Luis Alves added a comment - - edited To build the OriginalQueryParser. Delete OriginalQueryParser.java OriginalQueryParserConstants.java OriginalQueryParserTokenManager.java TokenMgrError.java JavaCharStream.java Token.java run JavaCC on QueryParser.jj. That will generate the all the classes Also, to avoid lots of warnings in the generated code: add @SupressWarnings("all") to QueryParserTokenManager.java, tokenMgrError.java, JavaCharStream.java, Token.java and JavaCharStream.java immediately preceding the class declaration. remove all imports from TokenMgrError.java If you delete ParseException. You will need to edit the ParseException class to extend from QueryNodeParseException class "public class ParseException extends QueryNodeParseException". Recreate the all the constructors like this: public ParseException(Token currentTokenVal, int [][] expectedTokenSequencesVal, String [] tokenImageVal) { super ( new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise( currentTokenVal, expectedTokenSequencesVal, tokenImageVal))); this .currentToken = currentTokenVal; this .expectedTokenSequences = expectedTokenSequencesVal; this .tokenImage = tokenImageVal; } public ParseException(Message message) { super (message); } public ParseException() { super ( new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error" )); } fix all imports This needs to be done after each time these files are generated by javacc.
          Hide
          Luis Alves added a comment -

          Hi Mike,

          I think I forgot to add a readme.txt to that folder describing how to build the OriginalQueryParser.jj.
          Can you please add that as part of this patch with the text in the comment above, If you are busy
          let know I can submit another patch with that.

          Show
          Luis Alves added a comment - Hi Mike, I think I forgot to add a readme.txt to that folder describing how to build the OriginalQueryParser.jj. Can you please add that as part of this patch with the text in the comment above, If you are busy let know I can submit another patch with that.
          Hide
          Michael McCandless added a comment -

          My reason for this, is that this change will make it more difficult for users
          that want to use several implementations of diff parsers at same time.

          Well... simple things should be simple; complex things should be
          possible.

          I expect the vast majority of Lucene users will use the standard
          QueryParser, as is. We should make things as simple as possible for
          such users.

          Then, more advanced users will absolutely love the modularity of this
          new QueryParser and cherry pick the parts they want to build up their
          own parsing chain. Things need not be simple for such users; just
          possible.

          I don't like the idea of "stripped Standard prefix" or "StandardQueryParserHelper to simply QueryParser".

          OK I do agree naming conflicts are a real hassle, and keeping this
          prefix doesn't harm the "simple" case...

          So I'll put back the prefixes to the Standard* classes, move the
          'original' package to 'standard'. So it'll be StandardQueryParser and
          the simple usage is like this:

          StandardQueryParser parser = new StandardQueryParser(analyzer);
          Query q = parser.parse("a OR b OR c", "field");
          

          I think I forgot to add a readme.txt to that folder describing how to build the OriginalQueryParser.jj.
          Can you please add that as part of this patch with the text in the comment above, If you are busy
          let know I can submit another patch with that.

          OK will do.

          Show
          Michael McCandless added a comment - My reason for this, is that this change will make it more difficult for users that want to use several implementations of diff parsers at same time. Well... simple things should be simple; complex things should be possible. I expect the vast majority of Lucene users will use the standard QueryParser, as is. We should make things as simple as possible for such users. Then, more advanced users will absolutely love the modularity of this new QueryParser and cherry pick the parts they want to build up their own parsing chain. Things need not be simple for such users; just possible. I don't like the idea of "stripped Standard prefix" or "StandardQueryParserHelper to simply QueryParser". OK I do agree naming conflicts are a real hassle, and keeping this prefix doesn't harm the "simple" case... So I'll put back the prefixes to the Standard* classes, move the 'original' package to 'standard'. So it'll be StandardQueryParser and the simple usage is like this: StandardQueryParser parser = new StandardQueryParser(analyzer); Query q = parser.parse( "a OR b OR c" , "field" ); I think I forgot to add a readme.txt to that folder describing how to build the OriginalQueryParser.jj. Can you please add that as part of this patch with the text in the comment above, If you are busy let know I can submit another patch with that. OK will do.
          Hide
          Michael McCandless added a comment -

          OK new patch attached w/ the above renaming. I added a README.javacc, which I reference from the build.xml, about how to fully recreate the parser.

          Show
          Michael McCandless added a comment - OK new patch attached w/ the above renaming. I added a README.javacc, which I reference from the build.xml, about how to fully recreate the parser.
          Hide
          Luis Alves added a comment -

          I'm not able to apply your latest patch,
          all files under standart folder are considered updates, not new files.

          I'm using eclipse apply patch feature, is there special step I'm missing.

          Show
          Luis Alves added a comment - I'm not able to apply your latest patch, all files under standart folder are considered updates, not new files. I'm using eclipse apply patch feature, is there special step I'm missing.
          Hide
          Michael McCandless added a comment -

          I think if you run these commands, first, on a fresh checkout:

          svn move src/test/org/apache/lucene/queryParser/original src/test/org/apache/lucene/queryParser/standard
          svn move src/java/org/apache/lucene/queryParser/original src/java/org/apache/lucene/queryParser/standard
          svn move src/java/org/apache/lucene/queryParser/standard/OriginalQueryParserHelper.java src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java
          svn move src/java/org/apache/lucene/queryParser/standard/nodes/OriginalBooleanQueryNode.java src/java/org/apache/lucene/queryParser/standard/nodes/StandardBooleanQueryNode.java
          svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserConstants.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserConstants.java
          svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java
          svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserTokenManager.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserTokenManager.java
          svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.jj src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.jj
          svn move src/java/org/apache/lucene/queryParser/standard/processors/OriginalQueryNodeProcessorPipeline.java src/java/org/apache/lucene/queryParser/standard/processors/StandardQueryNodeProcessorPipeline.java
          svn move src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryTreeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryTreeBuilder.java
          svn move src/java/org/apache/lucene/queryParser/standard/builders/OriginalBooleanQueryNodeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java
          svn move src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryBuilder.java
          svn move src/java/org/apache/lucene/queryParser/standard/config/OriginalQueryConfigHandler.java src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java
          

          Then apply the patch, it should work?

          This happens because "svn diff" doesn't capture all required details (ie that things were moved around), and, the "svn patch" (that'd be able to correctly apply what had been created with "svn diff") isn't yet released.

          Show
          Michael McCandless added a comment - I think if you run these commands, first, on a fresh checkout: svn move src/test/org/apache/lucene/queryParser/original src/test/org/apache/lucene/queryParser/standard svn move src/java/org/apache/lucene/queryParser/original src/java/org/apache/lucene/queryParser/standard svn move src/java/org/apache/lucene/queryParser/standard/OriginalQueryParserHelper.java src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java svn move src/java/org/apache/lucene/queryParser/standard/nodes/OriginalBooleanQueryNode.java src/java/org/apache/lucene/queryParser/standard/nodes/StandardBooleanQueryNode.java svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserConstants.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserConstants.java svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserTokenManager.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserTokenManager.java svn move src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.jj src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.jj svn move src/java/org/apache/lucene/queryParser/standard/processors/OriginalQueryNodeProcessorPipeline.java src/java/org/apache/lucene/queryParser/standard/processors/StandardQueryNodeProcessorPipeline.java svn move src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryTreeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryTreeBuilder.java svn move src/java/org/apache/lucene/queryParser/standard/builders/OriginalBooleanQueryNodeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java svn move src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryBuilder.java svn move src/java/org/apache/lucene/queryParser/standard/config/OriginalQueryConfigHandler.java src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java Then apply the patch, it should work? This happens because "svn diff" doesn't capture all required details (ie that things were moved around), and, the "svn patch" (that'd be able to correctly apply what had been created with "svn diff") isn't yet released.
          Hide
          Luis Alves added a comment -

          I finally was able to apply the patch in eclipse.
          But I had to use a different approach to correct the problem in eclipse.

          On command-line a execute:

          cp -a src/test/org/apache/lucene/queryParser/original src/test/org/apache/lucene/queryParser/standard
          cp -a src/java/org/apache/lucene/queryParser/original src/java/org/apache/lucene/queryParser/standard
          cp src/java/org/apache/lucene/queryParser/standard/OriginalQueryParserHelper.java src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java
          cp src/java/org/apache/lucene/queryParser/standard/nodes/OriginalBooleanQueryNode.java src/java/org/apache/lucene/queryParser/standard/nodes/StandardBooleanQueryNode.java
          cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserConstants.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserConstants.java
          cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java
          cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserTokenManager.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserTokenManager.java
          cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.jj src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.jj
          cp src/java/org/apache/lucene/queryParser/standard/processors/OriginalQueryNodeProcessorPipeline.java src/java/org/apache/lucene/queryParser/standard/processors/StandardQueryNodeProcessorPipeline.java
          cp src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryTreeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryTreeBuilder.java
          cp src/java/org/apache/lucene/queryParser/standard/builders/OriginalBooleanQueryNodeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java
          cp src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryBuilder.java
          cp src/java/org/apache/lucene/queryParser/standard/config/OriginalQueryConfigHandler.java src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java
          

          and applied the patch.

          I did not see the readme.txt for the StandardSyntaxParser.jj, but everything else looks good.

          Show
          Luis Alves added a comment - I finally was able to apply the patch in eclipse. But I had to use a different approach to correct the problem in eclipse. On command-line a execute: cp -a src/test/org/apache/lucene/queryParser/original src/test/org/apache/lucene/queryParser/standard cp -a src/java/org/apache/lucene/queryParser/original src/java/org/apache/lucene/queryParser/standard cp src/java/org/apache/lucene/queryParser/standard/OriginalQueryParserHelper.java src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java cp src/java/org/apache/lucene/queryParser/standard/nodes/OriginalBooleanQueryNode.java src/java/org/apache/lucene/queryParser/standard/nodes/StandardBooleanQueryNode.java cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserConstants.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserConstants.java cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParserTokenManager.java src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserTokenManager.java cp src/java/org/apache/lucene/queryParser/standard/parser/OriginalSyntaxParser.jj src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.jj cp src/java/org/apache/lucene/queryParser/standard/processors/OriginalQueryNodeProcessorPipeline.java src/java/org/apache/lucene/queryParser/standard/processors/StandardQueryNodeProcessorPipeline.java cp src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryTreeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryTreeBuilder.java cp src/java/org/apache/lucene/queryParser/standard/builders/OriginalBooleanQueryNodeBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java cp src/java/org/apache/lucene/queryParser/standard/builders/OriginalQueryBuilder.java src/java/org/apache/lucene/queryParser/standard/builders/StandardQueryBuilder.java cp src/java/org/apache/lucene/queryParser/standard/config/OriginalQueryConfigHandler.java src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java and applied the patch. I did not see the readme.txt for the StandardSyntaxParser.jj, but everything else looks good.
          Hide
          Luis Alves added a comment -

          linking LUCENE-1782 with LUCENE-1567

          Show
          Luis Alves added a comment - linking LUCENE-1782 with LUCENE-1567
          Hide
          Michael McCandless added a comment -

          I did not see the readme.txt for the StandardSyntaxParser.jj, but everything else looks good

          It's "README.javacc", under contrib/queryparser.

          OK I'll commit shortly!

          Show
          Michael McCandless added a comment - I did not see the readme.txt for the StandardSyntaxParser.jj, but everything else looks good It's "README.javacc", under contrib/queryparser. OK I'll commit shortly!

            People

            • Assignee:
              Michael McCandless
              Reporter:
              Michael McCandless
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development