lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terry Steichen" <>
Subject Re: literal operator?
Date Sun, 23 Feb 2003 19:40:53 GMT
After viewing the ensuing clarifications on this, I would like to withdraw
my earlier support, at least for the moment.  My reasons are (a) the fact
that this would only apply to the Keyword field, and (b) the use of the
single quote as the trigger.  Both of these lead me to the new view that
this would not only be limited in its added value, but would indeed likely
be confusing.



----- Original Message -----
From: "Tatu Saloranta" <>
To: "Lucene Developers List" <>
Sent: Sunday, February 23, 2003 2:12 PM
Subject: Re: literal operator?

> On Sunday 23 February 2003 08:56, Matthew King wrote:
> > I'd thought this went into the black hole of feature requests never to
> > return. ;)
> >
> > I also agree that the single quote is probably a bad choice for an
> > operator.  In my code i'm actually using "#lit(<term>)" to make things
> > as unambiguous as possible.  (but this doesn't really follow the style
> > of other Lucene query syntax operators)
> I too think that while for programmers single quote might be ok (it's
> consistent with behaviour of many unix shells), end users would probably
> expect single and double quotes to either work the same, or single
> quote to be taken as literal (to be able to search "foobar's", in
> non-tokenized field?).
> One alternative would be using some other non-alphanum character either as
> prefix or suffix. First thing I can think of is using '=' suffix for exact
> match, so something like:
>   =foobar's
>   ="longer non-tokenizer phrase"
> and then either
>   field=value
> or
>   =field:value
> or
>   field:=value
> depending on what makes most sense for users (most intuitive), or that's
> easiest to implement.
> This is of course assuming = isn't already used for something else? (I
> think it is but perhaps I missed something).
> >
> > And the reason I didn't use getFieldQuery is because it is using the
> > analyzer to tokenize and would cause me to loose the raw terms, no?
> > Maybe i'm not understanding the code here?
> >
> > One thing to keep in mind is that literal queries will only work with
> > Keyword fields.  Literal searches will not work on fields that have
> > been stemmed at indexing time.  Perhaps the query parser could be made
> > smart enough to do what the user wants here without them having to ask?
> >   Do we know at query time what options a particular field was indexed
> > with?
> If that can be determined, it'd be good to do that... it makes no sense to
> analyzer when searching field that's not tokenized.
> But even if that can not be determined, it should be easy to implement
> feature on derived class, for individual apps. App knows which fields are
> tokenized, and can override getFieldQuery() to handle these fields
> from default implementation.
> As usual, it would be nice to have some documentation that explains how to
> it. Perhaps FAQ is not the right place... it would be nice to have "best
> practices" page that would contain hints, ideas and suggestions of how
> can be customized, how default functionality can be overridden, and
> it's usually done.
> -+ Tatu +-
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message