lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucenenet] codystott opened a new issue #400: QueryParser.Parse Error if Phrase Ends with Capitalized Conjunction
Date Sun, 10 Jan 2021 04:27:53 GMT

codystott opened a new issue #400:
URL: https://github.com/apache/lucenenet/issues/400


   I was able to reproduce this with the following code:
   ````
   LuceneVersion AppLuceneVersion = LuceneVersion.LUCENE_48;
   QueryParser queryParser = new QueryParser(AppLuceneVersion, "name", new ClassicAnalyzer(AppLuceneVersion));
   queryParser.Parse("test AND");
   ````
   
   Lucene.Net.QueryParsers.Classic.ParseException
     HResult=0x80131500
     Message=Cannot parse 'test AND': Encountered "<EOF>" at line 1, column 8.
   Was expecting one of:
       <NOT> ...
       "+" ...
       "-" ...
       <BAREOPER> ...
       "(" ...
       "*" ...
       <QUOTED> ...
       <TERM> ...
       <PREFIXTERM> ...
       <WILDTERM> ...
       <REGEXPTERM> ...
       "[" ...
       "{" ...
       <NUMBER> ...
       <TERM> ...
       "*" ...
       
     Source=Lucene.Net.QueryParser
     StackTrace:
      at Lucene.Net.QueryParsers.Classic.QueryParserBase.Parse(String query)
      at LuceneSpecialCharTest.Program.Main(String[] args) in C:\Projects\LuceneSpecialCharTest\Program.cs:line
29
   
     This exception was originally thrown at this call stack:
   	Lucene.Net.QueryParsers.Classic.QueryParser.Jj_consume_token(int)
   	Lucene.Net.QueryParsers.Classic.QueryParser.Clause(string)
   	Lucene.Net.QueryParsers.Classic.QueryParser.Query(string)
   	Lucene.Net.QueryParsers.Classic.QueryParser.TopLevelQuery(string)
   	Lucene.Net.QueryParsers.Classic.QueryParserBase.Parse(string)
   
   Inner Exception 1:
   ParseException: Encountered "<EOF>" at line 1, column 8.
   Was expecting one of:
       <NOT> ...
       "+" ...
       "-" ...
       <BAREOPER> ...
       "(" ...
       "*" ...
       <QUOTED> ...
       <TERM> ...
       <PREFIXTERM> ...
       <WILDTERM> ...
       <REGEXPTERM> ...
       "[" ...
       "{" ...
       <NUMBER> ...
       <TERM> ...
       "*" ...


----------------------------------------------------------------
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.

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



Mime
View raw message