lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darren Govoni <dar...@ontrenet.com>
Subject Re: How to search for "-2" in field?
Date Thu, 11 Dec 2008 17:58:24 GMT
I'm using Luke to find the right combination of quotes,\'s and
analyzers.

No combination can produce a positive result for "-2 String" for the
field 'type'. (any -<number> <String>)

type: 0 -2 Word

analyzer:
query -> rewritten = result

default field is 'type'.

WhitespaceAnalyzer:
\"-2 ConfigurationFile\"  -> type:"-2 type:ConfigurationFile" = NO
-2 ConfigurationFile -> -type:2 type:ConfigurationFile = NO
\-2 ConfigurationFile -> type:-2 type:ConfigurationFile = NO
"\-2 ConfigurationFile" -> type:"-2 ConfigurationFile" = NO (thought
this one would work).

Same results for the other analyzers more or less.

Weird.

Darren



On Thu, 2008-12-11 at 23:02 +0530, prabin meitei wrote:
> Hi,  While constructing the query give the query string in quotes.
> eg: query = queryparser.parse("\"-2 word\"");
> 
> Prabin meitei
> toostep.com
> 
> On Thu, Dec 11, 2008 at 10:37 PM, Darren Govoni <darren@ontrenet.com> wrote:
> 
> > I'm hoping to do this with a simple query string, but not sure if its
> > possible. I'll try your suggestion though as a workaround.
> >
> > Thanks!!
> >
> > On Thu, 2008-12-11 at 16:48 +0000, Robert Young wrote:
> > > You could do it with a TermQuery but I'm not quite sure if that's the
> > answer
> > > you're looking for.
> > >
> > > Cheers
> > > Rob
> > >
> > > On Thu, Dec 11, 2008 at 3:59 PM, Darren Govoni <darren@ontrenet.com>
> > wrote:
> > >
> > > > Hi,
> > > >  This might be a dumb question, but I have a simple field like this
> > > >
> > > > field: 0 -2 Word
> > > >
> > > > that is indexed,tokenized and stored. I've tried various ways in Lucene
> > > > (using Luke) to search for "-2 Word" and none of them work, the query
> > is
> > > > re-written improperly. I escaped the -2 to "\-2 Word" and it still
> > > > doesn't work. I've used all the analyzers.
> > > >
> > > >
> > > > What's the trick here?
> > > >
> > > > Thanks,
> > > > Darren
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > > >
> > > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message