문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top