views:

43

answers:

1

i got 2 tables:

threads: id, title

posts: id, thread_id, body

i want a document to contain the thread and all the posts that belong to it. why doesnt this work:

<document>
    <entity name="threads"
            query="select id, title from threads">
                        <field column="title" name="threads.title"/>
                        <entity name="posts"
                                        query="select id, thread_id, body from posts where thread_id='${threads.id}'">
                                        <field column="id" name="posts.id"/>
                                        <field column="thread_id" name="posts.thread_id"/>
                                        <field column="body" name="posts.body"/>
                        </entity>
    </entity>

</document>

it says that total rows fetch are 228. but it tells that 0 documents were added. why is that?

+1  A: 

When I have seen this issue, it's normally an indexing error. Unfortunantly DIH doesn't always easily bubble up error messages to where you can see them!

Eric Pugh