lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Halácsy Péter <halacsy.pe...@axelero.com>
Subject RE: QueryParser for default AND
Date Mon, 08 Apr 2002 08:40:26 GMT
> -----Original Message-----
> From: Melissa Mifsud [mailto:melissamifsud@yahoo.com]
> Sent: Sunday, April 07, 2002 3:00 PM
> To: Lucene Developers List
> Subject: Re: QueryParser for default AND
> 
> 
> Can we please verify:
> 
>      new mode: +a +b +c +d
> 
> just mean that you have to pre-append "+" to each term in the 
> query string?
> 
> Query String = World Wide Web
> AND Query String = +World +Wide +Web
> 
> So that the AND query string means that you would like to 
> search all those
> documents in which ALL the terms in the query appear?
Yes. The query World Wide Web could be parsed/processed as

World OR Wide OR Web                            - every term is optional (not required) and
not prohibited
World AND Wide AND Web                        - every term is requiered and not prohibited
"World Wide Web"                                     - as a phrase

I prefer option II because I think a user don't like to get too much result even if the first
ones are great.

If I search for World Wide Web I don't want to get result about
country wide promotion
world bank
web publishing

> 
> Melissa.
> 

peter


> 
> ----- Original Message -----
> From: "Halácsy Péter" <halacsy.peter@axelero.hu>
> To: "Lucene Developer" <lucene-dev@jakarta.apache.org>
> Sent: Saturday, April 06, 2002 8:40 PM
> Subject: QueryParser for default AND
> 
> 
> > 19 Febr. Doug wrote:
> >
> > >> How could I modify the queryParser to implement
> > >> default AND logic?
> >
> > >I haven't tested this, but it should be as simple as 
> changing line 318 of
> > >QueryParser.jj to:
> > >  int ret = MOD_REQ;
> >
> > >Unfortunately, I think this would end up disabling OR, so 
> the proper
> change
> > >is more complex, requiring some changes to the addClause() 
> method.  This
> > >should also be something that folks can turn on and off.
> >
> > >Doug
> >
> > I attached a modified QueryParser.jj. Finally I modified 
> addClause(). I
> also
> > attached a tester class.
> >
> > Use:
> > QueryParser qp = new QueryParser(defaultField, analyzer);
> > qp.setMode(QueryParser.MODE_DEFAULT_END);
> >
> > Please try & test it.
> >
> > Some results:
> > Query: a b c d
> > classic mode: a b c d
> >     new mode: +a +b +c +d
> >
> > Query: a AND NOT b
> > classic mode: +a -b
> >     new mode: +a -b
> >
> > Query: a OR b
> > classic mode: a b
> >     new mode: a b
> >
> > Query: a b c -d
> > classic mode: a b c -d
> >     new mode: +a +b +c -d
> >
> > Query: Capital of Hungary
> > classic mode: capital of hungary
> >     new mode: +capital +of +hungary
> >
> >
> > Peter
> >
> >
> >
> >
> 
> 
> --------------------------------------------------------------
> --------------
> ----
> 
> 
> > --
> > To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
> 
> 
> 
> _________________________________________________________
> 
> Do You Yahoo!?
> 
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:lucene-dev-help@jakarta.apache.org>
> 
> 

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


Mime
View raw message