Erick Erickson wrote:

...

> It seems to me that you can always do something like:
> BooleanQuery bq;
> QueryParser qp1 = new QueryParser("field1", "<your query fragment
here>", analyzer); 
> Query q1 = qp1.parse("search term or clause); bq.add(q1,,,);
> QueryParser qp2 = new QueryParser("field2", "<your query fragment
here>", analyzer); 
> Query q2 = qp2.parse("search term or clause); bq.add(q2....);


> and eventually submit the query you've build up in bq.

<snip/>

Thanks for the idea - someone else also mentioned it yesterday, and I
think its possibly the way I'll go.
The only problem I have with this is that QueryParser also parses out
operators in the queries. No problem - I could just override the
relevant factory methods and throw an exception to indicate the operator
isn't supported.
However, QueryParser also parses out operators like "+" etc - which I
(and my Analyser) may want to include in the search (for example, I
might be searching for C++). So then, I've also got to escape these in
the user query... And so the work mounts up :o)

> As I said, I have no clue whether this is possible in your
application. If not, see below <G>.

> ********************Scree starts
here***********************************

> I've had similar arguments with myself. But I'm getting less forgiving
with myself 
> when I reinvent wheels, and firmly slap my own wrists.

> Pretend you are talking to your boss/technical lead/coworker. I'm
assuming you actually 
> want to get a product out the door. Your manager asks: "How can you
justify spending 
> the time to create, debug and maintain code that has already been
written for you for 
> the sake of cleanliness at the expense of the other things you could
be contributing instead"?

In this instance, I have the luxuary that this project is something Im
doing in my own time as a hobby. I can therefore afford time to mull
over my design, and maybe even contribute something back to the lucene
community in the process. After all, I owe Lucene big time :o)

<snip/>

> As you can see, this is one of my hot-button issues <G>. 

:o)

> If you want to really see me go off the deep end, 
> just *mention* premature optimizations........

I'd have to agree with you on that one.... :o)

> Best
> Erick


Dave


This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to