lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Powers <>
Subject ParseQuery with quotes
Date Tue, 20 Dec 2005 17:48:24 GMT
I would like to be able to search for 19 inches with the quote.  So I get a
query like this:
Line 1:  +( (name:19"*^4 ld:19"*^2 sd:19"*^3 kw:19"*^1) )

That won't work, so I wanted to escape the quotes.    The docs said to use a
backslash.  So I'm doing this:

luceneQuery.toString().replaceAll("\"", "\\\\\"")

And the result is:

Line 2:  +( (name:19\"*^4 ld:19\"*^2 sd:19\"*^3 kw:19\"*^1) )

This looks right.  Then I put it into a MultiFieldQueryParser.parse() via:

            query =
"\\\\\""), Indexer.CARTABLE, Indexer.analyzer);

and I get:

Parsed query: +(name:19"*^4.0 ld:19"*^2.0 sd:19"*^3.0 kw:19"*)

Which of course, won't work.   How can I get the escapes to survive through
the parsing?

Line two looks like what I want right before it gets parsed.

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

View raw message