Re: query parser field name aliases

2006-06-05 Thread karl wettin
On Mon, 2006-06-05 at 11:45 -0700, Chris Hostetter wrote: > thought "Wrapper" was an official pattern name It is. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: query parser field name aliases

2006-06-05 Thread Chris Hostetter
: > you might be able to go with a Delegator/Wrapper .. subclass : > QueryParser to inherit the grammer, override all of the normal methods : > you override in a subclass to include your field aliasing, but instead : > of defering to super defer to another instance of QueryParser : > specified at

Re: query parser field name aliases

2006-06-05 Thread karl wettin
On Mon, 2006-06-05 at 13:45 -0400, Yonik Seeley wrote: > Karl, taking this in context with your other threads, it seems like > you are tring to insert extra functionality at many different points > in lucene. Would some type of AOP work for you? I'm not sure I know what you mean. Try to decouple

Re: query parser field name aliases

2006-06-05 Thread karl wettin
On Mon, 2006-06-05 at 10:41 -0700, Chris Hostetter wrote: > > you might be able to go with a Delegator/Wrapper .. subclass > QueryParser to inherit the grammer, override all of the normal methods > you override in a subclass to include your field aliasing, but instead > of defering to super defer

Re: query parser field name aliases

2006-06-05 Thread Yonik Seeley
Karl, taking this in context with your other threads, it seems like you are tring to insert extra functionality at many different points in lucene. Would some type of AOP work for you? -Yonik On 6/5/06, karl wettin <[EMAIL PROTECTED]> wrote: On Mon, 2006-06-05 at 12:58 -0400, Erik Hatcher wrot

Re: query parser field name aliases

2006-06-05 Thread Chris Hostetter
: 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. you might be able to go with a Delegator/Wrapper .. subclass QueryParser to inherit the grammer, override all of the normal me

Re: query parser field name aliases

2006-06-05 Thread karl wettin
On Mon, 2006-06-05 at 12:58 -0400, Erik Hatcher wrote: > > Huh? Could you elaborate on what won't work about subclassing? I would for instance have to add the same chunk of code to my QueryParser- and my MultiFieldQueryParser-subclass.

Re: query parser field name aliases

2006-06-05 Thread Erik Hatcher
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 r

Re: query parser field name aliases

2006-06-05 Thread karl wettin
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

Re: query parser field name aliases

2006-06-04 Thread Chris Hostetter
: Indeed! I agree - I was temporarily blinded by the desire to hack : QueryParser itself in perhaps a one-off way that I didn't consider : the subclassing option. if all you care about is aliasing term, and phrase queries yiu might even be able to use the DisjunctionMaxQueryParser i wrote for So

Re: query parser field name aliases

2006-06-04 Thread Erik Hatcher
On Jun 4, 2006, at 8:55 PM, 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 passing a Map to the parser. The data could be compiled from the index. "name", "nam", "na" and "n" all

Re: query parser field name aliases

2006-06-04 Thread Daniel Noll
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 passing a Map to the parser. The data could be compiled from the index. "name", "nam", "na" and "n" all trigger on "name", taking there is no other field st

Re: query parser field name aliases

2006-06-04 Thread Erik Hatcher
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 passing a Map to the parser. The data could be compiled from the index. "name", "nam", "na" and "n" all trigger on "name", taking there is no other field starting with an "n"

query parser field name aliases

2006-06-04 Thread karl wettin
I was thinking it could be nice if the query parser handled aliases by passing a Map to the parser. The data could be compiled from the index. "name", "nam", "na" and "n" all trigger on "name", taking there is no other field starting with an "n". Did anyone implement this, or should I hack one u