lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew B. Merrill" <...@nmi.net>
Subject Escape woes
Date Tue, 16 Jul 2002 18:46:07 GMT

Hello all.  I'm having a problem with escaping Lucene characters, and I
was wondering if anyone here could help.

I've set up a Keyword field for my documents named "host".  "host" can
contain names like "ocrlprod" or "ny-dns-2".  I'm pretty sure that I
want it to be a Keyword (rather than Text), so that it isn't tokenized.

The problem is when I need to search against that field.  For example:

search string I construct: (host:orclprod)
query as reported by toString(): +host:orclprod

returns the results I expect.  Great so far.

search string I construct: (host:ny-dns-2)
query as reported by toString(): +(host:ny -dns -2)

does not return any results.  After reading about needing to escape
special characters, I'm not surprised, and move on to...

search string I construct: (host:ny\-dns\-2)
query as reported by toString():  +host:"ny dns 2"

does not return any results.  What happened to my hyphens?!?!  Is there
any way to get them to show up, as I expect I need them to?

Thanks for any help.

--- Matt

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message