Hi,

Im very new to Lucene - so sorry if my question seems pretty dumb.

In the application Im writing, I've been "struggling with myself" over
whether I should be building up queries programatically, or using the
Query Parser.

My searchable fields are driven by meta-data, and I only want to support
a few query types. It seems "cleaner" to build the queries up
programatically rather than converting the query to a string and
throwing it through the QueryParser.

However, then we hit the problem that the QueryParser takes care of
Analysing the search strings - so to do this we'd have to write some
utility stuff to perform the analysis as we're building up the queries /
terms.

And then I think "might as well just use the QueryParser!".

So here's what Im wondering (which probably sounds very dumb to
experienced Lucene'rs):

- Is there maybe some room for more utility classes in Lucene which make
this easier? E.g: When building up a document, we don't have to worry
about running content through an analyser - but unless we use
QueryParser, there doesn't seem to be corresponding behaviour on the
search side.
- So, Im thinking some kind of factory / builder or something, where you
can register an Analyser (possibly a per field wrapper), and then it is
applied per field as the query is being built up programatically.

Maybe this is just an "extraction" refactoring to take this behaviour
out of QueryParser (which could delegate to it).

The result could be that more users opt for a programatic build up of
queries (because it's become easier to do..) rather than falling back on
QueryParser in cases where it may not be the best choice.


Sorry if I rambled too much :o)

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