Hi,

I am trying to define application specific enums in solr. While running test 
cases, solr complains for unknown type, here are the steps performed:


1.       Defined enum type in schema.xml like

     <field name="changeType" type="operationType" indexed="true" stored="true" 
/>
  <filedType name="operationType" class="solr.EnumField" 
enumsConfig="enums.xml" enumName="operation"/>


2.       Created enums.xml in conf directory with contents

   <?xml version="1.0" ?>
<enumsConfig>
       <enum name="operation">
              <pair name="activation" value="0" />
              <pair name="deletion" value="1" />
              <pair name="modification" value="2" />
       </enum>

       <enum name="source">
              <pair name="activation" value="0" />
              <pair name="import" value="1" />
       </enum>

</enumsConfig>



3.  Used this enum in code like:


SolrInputDocument newDoc = new SolrInputDocument();
               newDoc.addField("changeType", "activation");




It is giving error:

Unknown fieldType 'operationType' specified on field changeType.

I am using solr 4.8.1. Not sure which step I am missing due to which it is 
unable to map proper fieldType.

Regards,
Prateek Jain

Reply via email to