I'm having a difficult time understanding how multivariable fields work with
the DataImportHandler when the source is a RDBMS. I've read the following
from the wiki:

----------
What is a row?

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. 
--------------

How does one 'join an entity with another'?  Below are the relevant sections
of my schema.xml and data-config.xml.

schema.xml

<dynamicField name="*_s"  type="string"  indexed="true"  stored="true"
multiValued="true" />

=========

data-config.xml

<entity name="item" query="select * from project_items where
projectid_fk=1">
            <field column="ID_PK" name="id" />
             <entity name="terms" query="select distinct DESC_TERM from
tem_metadata where item_id=${item.ID_PK}">
                      <entity name="metadata" query="select * from
term_metadata where item_id=${item.ID_PK} AND
desc_term='${terms.DESC_TERM}'" >
                             <field name="${terms.DESC_TERM}_s"
column="TEXT_VALUE" />
                       </entity>
              </entity>
</entity>

========================

I have multiple terms (rows) in the term_metadata table that are returned
from the query, but only the first one gets added. Am I missing something
obvious?


























-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/DIH-and-multivariable-fields-problems-tp1032893p1032893.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to