On 04/12/2012, Spadez <james_will...@hotmail.com> wrote:
> Thank you so much for your help. Based on the same schema in my first post
> and your help I created this, have I implemented it correctly based on your
> suggestion? I tried to comment it:

Looks almost correct. You only need two levels of
nesting, and can use proper nesting to differentiate
between the different "name" attributes.

<dataConfig>
  <dataSource name="app-ds" driver="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/wikipedia" user="wikipedia"
password="secret" />
     <document>
          <entity dataSource="app-ds" name="item" query="SELECT id,
title, description, date, link, location_id, source_id, company_id
from item">
                        <field column="id" name="id" />
                        <field column="title" name="title" />
                        <field column="description" name="description" />       
                
                        <field column="date" name="date" />
                        <field column="link" name="link" />

                        <entity dataSource="app-ds" name="location" 
query="SELECT
name, coordinate from location where location_id=${item.location_id}">
                             <field column="name" name="location_name" />
                             <field column="coordinate" 
name="location_coordinates" />
                       </entity>

                       <entity dataSource="app-ds" name="source"
query="SELECT name from source where source_id=${item.source_id}">
                             <field column="name" name="source_name" />
                       </entity>

                       <entity dataSource="app-ds" name="company"
query="SELECT name from company where company_id=${item.company_id}">
                             <field column="name" name="company_name" />
                         </entity>
                </entity>
        </document>
</dataConfig>
>
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/SQL-DIH-Can-I-have-some-guidance-please-tp4024207p4024235.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to