Follow-up: it seems the schema parser doesn't barf if you use xinclude with a single analyzer element, but so far seems like it's impossible for a field type. So this seems to work:
<fieldType name="text" class="solr.TextField" positionIncrementGap="100" > <xi:include href="solr/core2/conf/text-analyzer.xml" > <xi:fallback> <analyzer type="index"> ... </analyzer> </xi:fallback> </xi:include> <analyzer type="query"> ... </analyzer> </fieldType> On Sat, Nov 28, 2009 at 1:40 PM, Peter Wolanin <peter.wola...@acquia.com> wrote: > I'm trying to determine if it's possible to use Xinclude to (for > example) have a base schema file and then substitute various pieces. > > It seems that the schema fieldTypes throw exceptions if there is an > unexpected attribute? > > SEVERE: java.lang.RuntimeException: schema fieldtype > text(org.apache.solr.schema.TextField) invalid > arguments:{xml:base=solr/core2/conf/text-analyzer.xml} > > This is what I'm trying to do (details of the analyzer chain omitted - > nothing unusual) - so the error occurs when the external xml file is > actually included: > > <xi:include href="solr/core2/conf/text-analyzer.xml" > xmlns:xi="http://www.w3.org/2001/XInclude" > > <xi:fallback> > <fieldType name="text" class="solr.TextField" positionIncrementGap="100" > > <analyzer type="index"> > ... > </analyzer> > <analyzer type="query"> > ... > </analyzer> > </fieldType> > </xi:fallback> > </xi:include> > > > Where (for testing) the text-analyzer.xml file just looks like the fallback: > > > <?xml version="1.0" encoding="UTF-8" ?> > <fieldType name="text" class="solr.TextField" positionIncrementGap="100" > > <analyzer type="index"> > ... > </analyzer> > <analyzer type="query"> > ... > </analyzer> > </fieldType> > > > -- > Peter M. Wolanin, Ph.D. > Momentum Specialist, Acquia. Inc. > peter.wola...@acquia.com > -- Peter M. Wolanin, Ph.D. Momentum Specialist, Acquia. Inc. peter.wola...@acquia.com