You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2022/04/15 15:46:42 UTC

[GitHub] [lucenenet] NightOwl888 commented on issue #632: Cannot parse 'XX*': Encountered ""

NightOwl888 commented on issue #632:
URL: https://github.com/apache/lucenenet/issues/632#issuecomment-1100187973

   What datatype is `{input}`?
   
   I suspect you might be having parse issues due to the culture of the current thread in your application, which may be formatting `{input}` in an unexpected way. You may need to use [`FormattableString.Invariant()`](https://docs.microsoft.com/en-us/dotnet/api/system.formattablestring.invariant?view=net-6.0).
   
   Note also that the parsing may be failing because a new `QueryParser` instance uses the culture of the current thread by default and you may need to change the culture.
   
   ```c#
   var parser = new MultiFieldQueryParser(LuceneVersion.LUCENE_48, new string[] { "foo", "bar" }, analyzer)
   {
       Locale = CultureInfo.InvariantCulture
   };
   ```
   
   Whatever the case, you should be able to debug what is happening by recording the culture and value to be parsed during a failure and then you should reproduce the issue in a debug environment so you can step through to debug. Note that you can [enable Source Link](https://lucenenet.apache.org/docs/4.8.0-beta00016/api/core/source-stepping.html) on 4.8.0-beta00016 so you can step into the QueryParser code also.


-- 
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: dev-unsubscribe@lucenenet.apache.org

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