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