lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Davis <>
Subject QueryParser handling of backslash characters
Date Tue, 19 Jul 2005 15:19:51 GMT

I'm seeing some strange behavior in the way the QueryParser handles
consecutive backslash characters.  I know that backslash is the escape
character in Lucene, and so I would expect "\\\\" to match fields that
have two consecutive backslashes, but this does not seem to be the

The fields I'm searching are UNC paths, e.g. "\\\public". 
The only way I can get my query to find the record containing that
value is to type "FieldName:\\\\\public" (three slashes). 
Why is the third backslash character not treated as an escape?  Is it
just that any backslash that is preceded by a backslash is interpreted
as a literal backslash character, regardless of whether the "escape"
backslash was itself escaped?

I can code around this, but it seems inconsistent with the way that
escape characters usually work.  Is this a bug, or is it intentional,
or am I missing something?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message