Hi Clemens,

I think the problem is the structure of the composite schema - you’ll end up 
with:

<schema>   <- your other schema file
  <schema> <- the included schema-common.xml
    <copyField source=“_my_title” …
    <fields>
      <field name=“_my_title” …

Field declarations are found in the schema using XPath expressions 
"/schema/fields/field” and "/schema/field”, which won’t be found, since in your 
composite schema they’re at “/schema/schema/fields/field”.  You’re seeing the 
copyField error because copyField rules are found via XPath expression 
“//copyField”: they are found regardless of the containing structure.

One way to address the issue you’re seeing is to remove the top-level 
<schema></schema> tags from your schema-common.xml.  You won’t be able to use 
it alone in that case, but if you need to do that, you could just create 
another schema file that includes it inside wrapping <schema></schema> tags.

Steve

> On May 15, 2015, at 4:01 AM, Clemens Wyss DEV <clemens...@mysign.ch> wrote:
> 
> Given the following schema.xml
> <?xml version="1.0" encoding="UTF-8" ?>
> <schema name="locale_de" version="1.5">
>  <uniqueKey>_my_id</uniqueKey>
>  <field indexed="true" name="_version_" stored="true" type="long"/>
>  <copyField dest="_my_suggest" source="_my_title"/>
>  <fields>
>    <field indexed="true" multiValued="false" name="_my_id" required="true" 
> stored="true" type="string"/>
>    <field indexed="true" multiValued="false" name="_my_title" required="true" 
>  stored="true" type="string"/>
>    <field indexed="true" multiValued="true" name="_my_suggest" stored="false" 
> type="string"/> 
>  </fields>
>   <types>
>    <fieldType class="solr.StrField" name="string" sortMissingLast="true"/>
>     <fieldType class="solr.TrieLongField" name="long" 
> positionIncrementGap="0" precisionStep="0"/>
>  </types>
> </schema>
> 
> When I try to include the very schema from another schema file, e.g.:
> <?xml version="1.0" encoding="UTF-8" ?>
> <schema name="locale_de" version="1.5">
>  <xi:include href="schema-common.xml" 
> xmlns:xi="http://www.w3.org/2001/XInclude"/> 
> </schema>
> 
> I get SolrException
> copyField source :'_my_title' is not a glob and doesn't match any explicit 
> field or dynamicField
> 
> Am I facing a bug or a feature?
> 
> Thanks
> - Clemens

Reply via email to