lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terry Steichen" <te...@net-frame.com>
Subject Re: literal operator?
Date Sun, 23 Feb 2003 15:18:37 GMT
Otis, Matt -

I think the idea of adding the capability to do a literal search is
excellent.  However, I don't know enough of the parser details to comment on
Matt's specific suggested implementation.  I would suggest that, before you
implemented such an enhancement, you publish to the list precisely what the
user-level syntax would be.  Then we'd be in a better position to comment on
whether or not it would be confusing.

Regards,

Terry

----- Original Message -----
From: "Otis Gospodnetic" <otis_gospodnetic@yahoo.com>
To: "Lucene Developers List" <lucene-dev@jakarta.apache.org>
Cc: "Matthew King" <mattl@gnik.com>
Sent: Sunday, February 23, 2003 2:35 AM
Subject: Re: literal operator?


> Hello Matthew,
>
> Nobody responded to this one.
> Any strong opinions about including this from developers?
> I thought this would be a useful thing, at first, but it may confuse
> people (users, not developers) more if they search for 'some phrase
> with stop words'.  Actually, the diff uses TermQuery, not QueryParser's
> getFieldQuery method, so it wouldn't really work for phrases.
> Matthew, how come you didn't use getFieldQuery, like it is done for
> PhraseQuery, for instance?  That would allow you to support searching
> for literal keywords/terms and phrases, I believe.
>
> Does anyone think that including this would be a good idea?
>
> Thanks,
> Otis
>
>
> --- Matthew King <mattl@gnik.com> wrote:
> > I just ran into a little problem while trying to query for a document
> >
> > looking for a term that had been indexed using a Keyword field...
> >
> > My application is using the StandardAnalyzer and the QueryParser to
> > search the index, so my query looked something like this:
> >
> >    kw:FOOBAR
> >
> > not surprisingly (now that I know what's going on) I wasn't getting
> > any
> > hits from this search (because the QueryParser was normalizing the
> > query term be "foobar" when it had been indexed as "FOOBAR")
> >
> > I know that i could create my own query to search for "FOOBAR", but
> > it
> > seems reasonable to add a LITERAL operator so that keywords can be
> > searched using the QueryParser, no?
> >
> > Here's the diff for my stab at implementing it:
> >
> > diff -r1.25 QueryParser.jj
> > 319c319
> > <                           "[", "]", "\"", "{", "}", "~", "*", "?" ]
> > >
> > ---
> >  >                           "[", "]", "\"", "{", "}", "~", "*", "?",
> >
> > "'" ] >
> > 321c321
> > <                            "[", "]", "\"", "{", "}", "~", "*", "?"
> > ]
> > ---
> >  >                            "[", "]", "\"", "{", "}", "~", "*",
> > "?",
> > "'" ]
> > 350a351
> >  > | <LITERAL:    "'" (~["'"])+ "'">
> > 527a529,533
> >  >        }
> >  >      | term=<LITERAL>
> >  >        [ <CARAT> boost=<NUMBER> ]
> >  >        {
> >  >          q = new TermQuery(new Term(field, term.image.substring(1,
> >
> > term.image.length()-1)));
> >
> > I'm not so sure I like using the single quote here, but it was
> > available...
> >
> > What do people think?  Is this useful to others?
> >
> > - matt
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>


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


Mime
View raw message