-
In the Administration Console, select
Index > Connectors and then click Add connector.
-
For Name, type salesdb.
-
For Type, select Database (JDBC).
-
Click Accept.
-
For Store documents in data model class, enter
sales
. We will create this class later on.
-
In the Connection parameters section, complete the following:
-
Driver:
org.sqlite.JDBC
-
Connection string:
jdbc:sqlite://<PATH TO INSTALLDIR>/docs/sample_database/data.db
-
Click Test connection.
The database connector automatically connects to the database.
-
In the new Query parameters section that displays,
enter the following in Initial query:
SELECT po.id as id, datetime(po.date, "unixepoch") as date,
po.quantity as quantity, p.price as unit_price, s.country as store_country,
s.city as store_city, c.firstname as firstname, c.lastname as lastname,
p.review_score as review_score, p.description as description, p.color
as color, p.category as category, p.name as name
FROM product_order po inner join product p on p.id = po.product_id
inner join store s on s.id = po.store_id inner join customer c on c.id
= po.customer_id;
-
Click Retrieve fields.
We only need to set a field as being the primary key. The connector will use it to
identify each record, and construct the Exalead CloudView document URL.
-
Set the
id
field as primary key.
-
Click the
id
field to expand it.
-
Select Use as primary key.
-
Click Save.
You are now ready to modify the data model.