lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prateek Jain J <>
Subject Using Custom Enum
Date Mon, 25 Jan 2016 12:11:13 GMT

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" ?>
       <enum name="operation">
              <pair name="activation" value="0" />
              <pair name="deletion" value="1" />
              <pair name="modification" value="2" />

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


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

Prateek Jain

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message