You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "benchaplin (via GitHub)" <gi...@apache.org> on 2024/04/25 00:20:05 UTC

Re: [I] Query parser fails to parse a range query string when there are escaped brackets inside the range [lucene]

benchaplin commented on issue #13234:
URL: https://github.com/apache/lucene/issues/13234#issuecomment-2076083215

   You can get around this by placing each range term in quotes:
   
   ```java
   query = queryParser.parse( "[ \"2024\\-01\\-01T01\\:01\\:01\\+01\\:00\\[Europe\\/Warsaw\\]\" TO \"2025\\-01\\-01T01\\:01\\:01\\+01\\:00\\[Europe\\/Warsaw\\]\" ]" );
   ```
   
   In fact, then you don't need to escape anything other than the quotes:
   
   ```java
   query = queryParser.parse( "[ \"2024-01-01T01:01:01+01:00[Europe/Warsaw]\" TO \"2025-01-01T01:01:01+01:00[Europe/Warsaw]\" ]" );
   ```
   
   Both will be parsed to `[2024-01-01t01:01:01+01:00[europe/warsaw] TO 2025-01-01t01:01:01+01:00[europe/warsaw]]`.
   
   (I've added some tests showing this: https://github.com/apache/lucene/pull/13323)


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