Hi all,

I'm using DIH solr 3.5 to import data from mysql. In my document, I have
some fields: name, category, text_spell, ...
text_spell is a multi-valued field which combines from name and category
(category is a multi-value field as well).

<entity name="listing"
            query="SELECT uuid, name from listings" pk="uuid">
   <entity name="listing_categories"
              query="SELECT `categories`.`name` FROM categories INNER JOIN
`listing_categories` ON
`categories`.`uuid`=`listing_categories`.`category_uuid`) WHERE
`listing_categories`.`listing_uuid`='${listing.uuid}'">
        <field column="name" name="category" />
   </entity>
</entity>

In this case, I would use ScriptTransformer to produce a new array of
[name, category], but the from the example in solr
wiki<http://wiki.apache.org/solr/DataImportHandler#ScriptTransformer>,
it seems it could only access the current row in the current entity.
Is it possible to access other entities?

If not possible, how could i solve this problem. I know I could use UNION
statement, but it duplicates the query and it would degrade the performance
as well. Any idea?

-- 
Chamnap

Reply via email to