lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S Eslamian <seslam...@gmail.com>
Subject Re: searching minus digit
Date Tue, 24 Apr 2012 11:40:49 GMT
Thank you but when I search this : Query termQuery = new TermQuery
("field","\-1234"); I get this exception :
Invalid escape sequence (valid one are \b \t \n \f \r \" \' \\)

Am I making mistake in creating my query?

On Tue, Apr 24, 2012 at 3:52 PM, Erick Erickson <erickerickson@gmail.com>wrote:

> the - is part of the query syntax, you must escape it. See:
>
>
> http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/queryparsersyntax.html
>
> Best
> Erick
>
> On Tue, Apr 24, 2012 at 5:44 AM, S Eslamian <seslamian@gmail.com> wrote:
> > How can I search a minus digit like -123 in lucene?
> > When I search this,lucene excludes 123 from my search or returns no
> answer.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message