lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Lucene 2.9 and deprecated methods
Date Mon, 05 Oct 2009 07:15:26 GMT
> > On Sun, Oct 04, 2009 at 05:53:14AM -0400, Michael McCandless wrote:
> >
> > >   1 Do we prevent config settings from changing after creating an
> > >     IW/IR?
> >
> > Any settings conveyed via a settings object ought to be final if you
> want
> > pluggable index components.  Otherwise, you need some nightmarish
> > notification
> > system to propagate settings down into your subcomponents, which may or
> > may
> > not be prepared to handle the value modifications.
> +1, this is an argument in my opinion for final members/settings.
> By the way, there is a third possibility for passing configuration
> settings:
> The idea is to enable passing settings to IR/IW and its flexible indexing
> components by the same technique like JAXP does it (please don't hit me!):
> Pass a Properties or Map<String,?> to the ctor/open. The keys are
> predefined
> constants. Maybe our previous idea of an IndexConfiguration class is a
> subclass of HashMap<String,?> with all the constants and some easy-to-use
> setter methods for very often-used settings (like index dir) and some
> reasonable defaults.
> This allows us to pass these properties to any flex indexing component
> without need to modify/extend it to support the additional properties. The
> flexible indexing component just defines its own property names (e.g. as
> URNs, URLs, using its class name as prefix,...). Property names are always
> String, values any type (therefore Map<String,?>). With Java 5, integer
> props and so on are no "bad syntax" problem because of autoboxing (no need
> to pass new Integer() or Integer.valueOf()).
> Another good thing is, that implementors of e.g. XML config files like in
> Solr, can simple pass all elements in config to this map.

Another option for extensibility with type safety, properties would not
have, would be Attributes. Just pass an AttributeSource as configuration.
And the default index properties are one attribute where custom extensions
can define own ones.


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

View raw message