In Solr DIH data-config.xml, is it better to fetch as many fields as possible with the query in the main entity with JOIN like:
<entity name="Lists"
pk="l.list_id"
query="SELECT l.list_id AS id, l.user_id, lo.is_votable FROM lists l
INNER JOIN list_options lo ON lo.list_id = l.list_id">
or use a separate sub-entity like:
<entity name="Lists"
pk="l.list_id"
query="SELECT l.list_id AS id, l.user_id FROM lists l">
<entity name="ListOptions"
query="SELECT lo.is_votable FROM list_options lo
WHERE lo.list_id=${Lists.id}" />
</entity>
Few Pointers that may help you to decide :-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With