On Mon, 2006-06-05 at 10:55 +1000, Daniel Noll wrote:
> Erik Hatcher wrote:
> >
> > On Jun 4, 2006, at 5:57 PM, karl wettin wrote:
> >> I was thinking it could be nice if the query parser handled aliases by
> >
> > Rather than hacking QueryParser, simply do some regex replaces on the
> > string before handing it to parser. n:karl would get replaced with
> > name:karl. ([a-z]*)\: replaced with the field name that matches $1.
>
> It seems a little more elegant to extend from QueryParser in this
> situation. Override getFieldQuery which gets passed the field name
> string, and all you'd have to do is call the method in the superclass
> after modifying the field name.
There is a problem with this. Java does not allow multiple inheritance
and there are other subclasses of QueryParser. Perhaps I can fix it with
a decorator instead.
Thanks for the ideas!
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
|