Getting Started : Creating a Simple Search Application : Adding a Connector
 
Adding a Connector
Once you have defined the scope of your application, you can add and configure connectors to fetch documents from data sources and push them into Exalead CloudView. Exalead CloudView will convert these original documents into Exalead CloudView documents.
For details on using a Database connector and other connectors packaged by default with Exalead CloudView, see "Configuring the JDBC Database Connector" in the Exalead CloudView Connectors Guide.
The following tutorial explains how to connect to the sample database.
1. In the Administration Console, select Index > Connectors and then click Add connector.
a. For Name, type salesdb.
b. For Type, select Database (JDBC).
c. Click Accept.
2. For Store documents in data model class, enter sales. We will create this class later on.
3. In the Connection parameters section, complete the following:
a. Driver: org.sqlite.JDBC
b. Connection string: jdbc:sqlite://<PATH TO INSTALLDIR>/docs/sample_database/data.db
4. Click Test connection.
The database connector automatically connects to the database.
5. 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;
6. 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.
7. Set the id field as primary key.
a. Click the id field to expand it.
b. Select Use as primary key.
8. Click Save.
You are now ready to modify the data model.