Hi.

I am having a bit of trouble figuruing out the DIH for SQL files. I have
asked around a few different places but havent got any replies so I was
hoping you could help me.

*I have a database schema like this:*

CREATE TABLE company (
    id SERIAL PRIMARY KEY,
    name varchar(60) NOT NULL
);

CREATE TABLE country (
    id SERIAL PRIMARY KEY,
    name varchar(255) NOT NULL
);

CREATE TABLE location (
    id SERIAL PRIMARY KEY,
    name varchar(255) NOT NULL,
    coordinate varchar(255) NOT NULL,
    location_id integer NOT NULL REFERENCES country (id)
);

CREATE TABLE source (
    id SERIAL PRIMARY KEY,
    name varchar(60) NOT NULL
);

CREATE TABLE item (
    id SERIAL PRIMARY KEY,
    title varchar(60) NOT NULL,
    description varchar(900) NOT NULL,
    company_id integer NOT NULL REFERENCES company (id),
    date timestamp NOT NULL,
    source_id integer NOT NULL REFERENCES source (id),
    link varchar(255) NOT NULL,
    location_id integer NOT NULL REFERENCES location (id)
);

*My what I want to put into my schema is this information (named as they are
in my schema):*

id
title
description
date
source
link
location_name
location_coordinates

*I made my DIH like this:*

<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="application" query="SELECT id,
page_title from page">
                        <field column="id" name="id" />
                        <field column="title" name="title" />
                        <field column="description" name="description" />
                        <field column="date" name="date" />
                        <field column="name" name="source" />
                        <field column="link" name="link" />
                        <field column="name" name="location_name" />
                        <field column="coordinate" name="location_coordinates" 
/>
                </entity>
        </document>
</dataConfig>

My main questions relate to the entity datastore query and also what to do
for field columns when it is a linked table. For example the word "name"
isnt unique since it appears in several different tables.

I would really appreciate any help on this, its taken me a while to get to
this stage and now I am truely stuck.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/SQL-DIH-Can-I-have-some-guidance-please-tp4024207.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to