Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change 
notification.

The following page has been changed by NoblePaul:
http://wiki.apache.org/solr/DataImportHandler

------------------------------------------------------------------------------
  
  == EntityProcessor ==
  Each entity is handled by a default Entity processor called 
!SqlEntityProcessor. This works well for systems which use RDBMS as a 
datasource. For other kind of datasources like  REST or Non Sql datasources you 
can choose to implement this interface 
`org.apache.solr.handler.dataimport.Entityprocessor`
+ {{{
+ public interface EntityProcessor {
  
+     /**
+      * An instance of this is created everytime.
+      * This method is called soon after the Object is created.
+      *
+      * @param context       The current context
+      */
+     void init(Context context);
+ 
+     /**
+      * This method helps streaming the data for each row.
+      * The implementation would fetch as many rows as needed and gives one 
'row'
+      * at a time.
+      *
+      * @return A 'row' . The 'key' for the map is the column name and the 
'value' is the value
+      *         of that column. If there are no more rows to be returned, 
return 'null'
+      */
+     Map<String, Object> nextRow();
+ 
+     /**This method is called to get identify the root entities's promary keys 
whose
+      * documents have changed
+      * @return
+      */
+     Map<String, Object> nextModifiedRowKey();
+ 
+     /**This method is called to get identify the root entities's promary keys 
whose
+      * documents have changed
+      * @return
+      */
+ 
+     Map<String, Object> nextDeletedRowKey();
+     
+     
+     Map<String, Object> nextModifiedParentRowKey();
+ }
+ }}}
  cofigure it as follows
  {{{
  <entity name="foo" implClass="com.FooEntityProcessor" ..

Reply via email to