lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: search on colon ":" ending words
Date Fri, 23 Feb 2007 12:52:15 GMT
I'd *strongly* advise doing it the simple way, that is, your replace.

1> it's simple and understandable.
2> next time you upgrade Lucene you, or the next poor programmer, will have
to remember/reimplement your change to the parser.
3> How will you insure that others in your organization (and you 6 months
from now) won't spend lots of time wondering why ':' didn't work as a field
separator in the query parser? I flat guarantee this will cause you grief...
4> I don't want Otis, Erik and Yonik to have to spend time answering the
question "Why isn't ':' working as a field separator?" <G>.

Best
Erick

On 2/22/07, Felix Litman <f_litman@pacbell.net> wrote:
>
> OK. Thank you.  We'll have to consider using this approach.
>
>   I guess the drawback here is that ":" will not longer work as a field
> operator. ?:-(
>
>   We were also considering using the following approach.
>
>   String newquery = query.replace(query, ": ", " ");
>
>   It seems this way a colon should still work as a field operator if
> followed by a query term with no space in between
>
>   Thanks,
>   Felix.
>
> Antony Bowesman <adb@teamware.com> wrote:
>   Felix Litman wrote:
> > Yes. thank you. How did you make that modification not to treat ":" as a
> field-name terminator?
> >
> > Is it using this Or some other way?
>
> I removed the : handling stuff from QueryParser.jj in the method:
>
> Query Clause(String field) :
>
> I removed this section
> ---
> [
> LOOKAHEAD(2)
> (
> fieldToken= {field=discardEscapeChar(fieldToken.image);}
> | {field="*";}
> )
> ]
> ---
>
> and you can also remove the COLON and : related bits to do with start
> terms and
> escaped chars if you want to exclude treating : as a separator, but from
> memory,
> it's the above section that does the field recognition.
>
> Antony
>
>
> ---------------------------------------------------------------------
> 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