Reputation: 18610
I have a master/detail table that I would like to import in Solr so I can query it. Now it appears to me that only the first row of the detail table is imported.
How do I import all rows from the detail table?
I currently have something like this in my data import handler query:
<entity name="master" query="SELECT id, name, description,
FROM master WHERE isapproved = 1">
<!-- snip -->
<entity name="details" query="SELECT sku,description,price
FROM details WHERE masterid='${master.id}'">
<field column="sku name="sku" />
</entity>
To make it a bit more difficult, sometimes there are only master rows without corresponding detail rows. So I could not reverse the query (select detail first and then master) because that would leave me without the master data.
What is a good solution?
Upvotes: 1
Views: 381
Reputation: 9500
Unfortunatly I do not see your schema.xml
, but it is likely that you forgot to mark your document attribute as multiValued="true"
there. In that case Solr would only fetch the first value and skip the rest.
Upvotes: 2