lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: query parser field name aliases
Date Mon, 05 Jun 2006 16:58:36 GMT

On Jun 5, 2006, at 11:07 AM, karl wettin wrote:
> 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.

Huh?   Could you elaborate on what won't work about subclassing?

	Erik


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


Mime
View raw message