You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/09/21 13:56:10 UTC

[GitHub] [lucene] gcbaptista opened a new issue, #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

gcbaptista opened a new issue, #11800:
URL: https://github.com/apache/lucene/issues/11800

   ### Description
   
   Since release `9.1.0`, Lucene's SyntaxParser have been uncapable to parse `@` in a query, throwing a Syntax Error (`INVALID_SYNTAX_CANNOT_PARSE`).
   Version `9.0.0` is the last I tested that still can parse this character.
   
   Two similar examples that throw `INVALID_SYNTAX_CANNOT_PARSE` in `9.1.0`, but not in `9.0.0`:
    - `\\ an@tomy`
    - `\\ @natomy`
   
   Leaving some log dump here:
   `Syntax Error, cannot parse \\ an@tomy:  
   INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse \\ an@tomy:  
   	at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.generateParseException(StandardSyntaxParser.java:2093)
   	at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.jj_consume_token(StandardSyntaxParser.java:1961)
   	at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.TopLevelQuery(StandardSyntaxParser.java:115)
   	at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.parse(StandardSyntaxParser.java:92)
   	at org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:214)
   	at org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:280)
   ...`
   
   
   
   ### Version and environment details
   
   - JDK: temurin-17.0.3
   - OS: MacOS Monterey 12.6 and alpine-java17:latest (docker image)
   - Lucene: 9.1.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] gcbaptista commented on issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
gcbaptista commented on issue #11800:
URL: https://github.com/apache/lucene/issues/11800#issuecomment-1254813633

   Hey again,
   So if I want my queries to support `@`, what should be my approach to keep the parsing compatibility from this version on?
   If there is no way to parse it right now, how should one escape the character? Would the regular escaping `\\` be enough in this case?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
rmuir commented on issue #11800:
URL: https://github.com/apache/lucene/issues/11800#issuecomment-1254008994

   not a bug, but related to new features added to the parser. see the associated message in `MIGRATE.txt`:
   
   ```
   ## Minor syntactical changes in StandardQueryParser (Lucene 9.1)
   
   LUCENE-10223 adds interval functions and min-should-match support to StandardQueryParser. This
   means that interval function prefixes ("fn:") and the '@' character after parentheses will
   parse differently than before. If you need the exact previous behavior, clone the StandardSyntaxParser from the previous version of Lucene and create a custom query parser
   with that parser.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11800:
URL: https://github.com/apache/lucene/issues/11800#issuecomment-1254016674

   Also, please note that you can quote the ampersand in terms - this will behave like before. I don't think it's a bug, sorry it caused you trouble but the new functionality is worth it (try it!).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11800:
URL: https://github.com/apache/lucene/issues/11800#issuecomment-1256036589

   Note this class is in a different package - it's a different query parser. There are many. They all behave differently. It's a project with long history.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] gcbaptista commented on issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
gcbaptista commented on issue #11800:
URL: https://github.com/apache/lucene/issues/11800#issuecomment-1255984965

   So why isn't this method escaping `@` then?
   
   https://github.com/apache/lucene/blob/5b24a233bdfd2c1feb177a5de4fc5eb62baf6015/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java#L965-L978


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] gcbaptista commented on issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
gcbaptista commented on issue #11800:
URL: https://github.com/apache/lucene/issues/11800#issuecomment-1256055850

   OK, thank you very much for the clarification 👍 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11800:
URL: https://github.com/apache/lucene/issues/11800#issuecomment-1255521641

   You can escape the at character:
   ```
   am\@zing
   ```
   or you can quote the term:
   ```
   "am\@zing"
   ```
   Or you can set up flexible query parser with your own syntax parser (which you'd source from a previous Lucene version).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss closed issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)

Posted by GitBox <gi...@apache.org>.
dweiss closed issue #11800: INVALID_SYNTAX_CANNOT_PARSE for at sign (@)
URL: https://github.com/apache/lucene/issues/11800


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org