lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark harwood <>
Subject Re: "Advanced" query language
Date Fri, 16 Dec 2005 07:51:59 GMT
> While SAX is fast, I've found callback interfaces
> more difficult to
> deal with while generating nested object graphs...
> it normally
> requires one to maintain state in stack(s).

I've gone to some trouble to avoid the effects of this
on the programming model.
Stack management is handled by the parser and the
builder at each level in the stack can delegate
control and consume output of delegate builders
without maintaining complex state.
For example, the builder for FilteredQuerys has to
handle this:
  <RangeFilter fieldName="price" lowerTerm="10"
 <Query><TermQuery field="contents"

To delegate control to any choice of filter or query
parser builder and consume its output it simply does

if (localName.equals("Filter")) {
   new ObjectConsumer() {
	public void setObject(Object objectValue) {
          filter = (Filter) objectValue;

It looks like procedural code calling, then setting
instance data ("filter") but is actually still all
event based SAX under the covers.


To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message