lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Trivial Update of "DataImportHandler" by KenGeis
Date Fri, 14 Oct 2011 16:22:32 GMT
Dear Wiki user,

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

The "DataImportHandler" page has been changed by KenGeis:
http://wiki.apache.org/solr/DataImportHandler?action=diff&rev1=294&rev2=295

Comment:
RDMS -> RDBMS

  A row in !DataImportHandler is a Map (Map<String, Object>). In the map , the key is
the name of the field and the value can be anything which is a valid Solr type. The value
can also be a Collection of the valid Solr types (this may get mapped to a multi-valued field).
If the !DataSource is RDBMS a query cannot emit a multivalued field. But it is possible to
create a multivalued field by joining an entity with another.i.e if the sub-entity returns
multiple rows for one row from parent entity it can go into a multivalued field. If the datasource
is xml, it is possible to return a multivalued field.
  
  == A VariableResolver ==
- A !VariableResolver is the component which replaces all those placeholders such as `${<name>}`.
It is a multilevel Map.  Each namespace is a Map and namespaces are separated by periods (.)
. eg if there is a placeholder ${item.ID} , 'item' is a nampespace (which is a map) and 'ID'
is a value in that namespace. It is possible to nest namespaces like ${item.x.ID} where x
could be another Map. A reference to the current !VariableResolver can be obtained from the
Context. Or the object can be directly consumed by using ${<name>} in 'query' for RDMS
queries or 'url' in Http .
+ A !VariableResolver is the component which replaces all those placeholders such as `${<name>}`.
It is a multilevel Map.  Each namespace is a Map and namespaces are separated by periods (.)
. eg if there is a placeholder ${item.ID} , 'item' is a nampespace (which is a map) and 'ID'
is a value in that namespace. It is possible to nest namespaces like ${item.x.ID} where x
could be another Map. A reference to the current !VariableResolver can be obtained from the
Context. Or the object can be directly consumed by using ${<name>} in 'query' for RDBMS
queries or 'url' in Http .
  
  === Custom formatting in query and url using Functions ===
  While the namespace concept is useful , the user may want to put some computed value into
the query or url for example there is a Date object and your datasource  accepts Date in some
custom format . There are a few functions provided by the !DataImportHandler which can do
some of these.

Mime
View raw message