Re: If statements in DataImportHandler?
Jason, have a look on http://wiki.apache.org/solr/DataImportHandler#Accessing_request_parameters , this might help you out. If not, you'd give us a quick example of what you plan to do? Regards Stefan
Re: If statements in DataImportHandler?
On Fri, Mar 11, 2011 at 10:23 AM, Jason Rutherglen wrote: > Right that's not within the XML however, and it's unclear how to > access the upper level entities that have already been instantiated, > eg, beyond the given 'transform' row. The second example for a ScriptTransformer in http://wiki.apache.org/solr/DataImportHandler#Transformer should give you an idea of how to proceed: * row.get( 'category' ) gets the field 'category' from the current entity to which the ScriptTransformer is being applied. * Fields from higher-level entities will need to be passed in using DIH variables. E.g., if you have a higher-level entity called 'parent', and are getting data from the current entity via a database select, e.g., you will need to modify the query to something like and add inside the current entity (cannot remember now if this is required, or can be dispensed with). Regards, Gora
Re: If statements in DataImportHandler?
Right that's not within the XML however, and it's unclear how to access the upper level entities that have already been instantiated, eg, beyond the given 'transform' row. On Thu, Mar 10, 2011 at 8:02 PM, Gora Mohanty wrote: > On Fri, Mar 11, 2011 at 4:48 AM, Jason Rutherglen > wrote: >> Is it possible to conditionally load sub-entities in >> DataImportHandler, based on the gathered value of parent entities? > > Probably the easies way to do that is with a transformer. > Please see the DIH Wiki page for details: > http://wiki.apache.org/solr/DataImportHandler#Transformer > > Regards, > Gora >
Re: If statements in DataImportHandler?
On Fri, Mar 11, 2011 at 4:48 AM, Jason Rutherglen wrote: > Is it possible to conditionally load sub-entities in > DataImportHandler, based on the gathered value of parent entities? Probably the easies way to do that is with a transformer. Please see the DIH Wiki page for details: http://wiki.apache.org/solr/DataImportHandler#Transformer Regards, Gora
If statements in DataImportHandler?
Is it possible to conditionally load sub-entities in DataImportHandler, based on the gathered value of parent entities?