Hi -

I'm new to Solr and am trying to combine a script:and & RegExTransformer in
a db-dataconfig.xml that is used to ingest data into Solr.  Can anyone be
of any help?

There is definitly a "comma" between my script:add , and addRegexTransfomer
lines.

Any help would be appreciated.

My db-data-config.xml looks like this?
<dataConfig>
  <dataSource type="JdbcDataSource" driver="org.postgresql.Driver"
url="jdbc:postgresql://localhost:/test?netTimeoutForStreamingResults=240000000"
autoReconnect="true" user="postgres" password="" batchSize ="100000"
responseBuffering="adaptive"/>
<script><![CDATA[
                function add(row)        {
    var latlon_s= row.get('longitude')+','+row.get('latitude');
    var provider = row.get('provider');
                    var pointPath = '/'+
row.get('longitude')+','+row.get('latitude')+'/'+row.get('basis_of_record');
                    if ('NatureServe'.equalsIgnoreCase(provider) || 'USDA
PLANTS'.equalsIgnoreCase(provider)) {
                         pointPath += '/centroid';
                     }
                    row.put('latlon_s', latlon_s);
    row.put('pointPath_s',pointPath);
    var provider_id = row.get('provider_id');
var resource_id = row.get('resource_id_s');
var hierarchy = row.get('hierarchy_string');
row.put('hierarchy_homonym_string', '-' + hierarchy + '-');
row.put('BISONResourceID', '/' + provider_id + '/' + resource_id +'/');
                    return row;
                }
        ]]></script>

<document name="itis_to_portal.occurence">
         <!--entity name="occurrence"  pk="id" transformer="script:add"
query="select id, scientific_name, latitude, longitude, year,
basis_of_record, provider_id,resource_id_s, occurrence_date,  tsns,
 parent_tsn, hierarchy_string, collector, ambiguous, statecomputedfips,
countycomputedfips from itis_to_portal.solr" transformer="RegexTransformer"
-->
 <entity name="occurrence"  pk="id" query="select id, scientific_name,
latitude, longitude, year, basis_of_record, provider_id,resource_id_s,
occurrence_date,  tsns,  parent_tsn, hierarchy_string, collector,
ambiguous, statecomputedfips, countycomputedfips from itis_to_portal.solr"
transformer="RegexTransformer,script:add" >

and at runtime import I'm getting the following error message,
SEVERE: Full Import failed:java.lang.RuntimeException:
java.lang.RuntimeException:
org.apache.solr.handler.dataimport.DataImportHandlerException: Could not
invoke method :addRegexTransformer

Thanks,
Doug

Reply via email to