How to Index Data from Gmail in SearchBlox

How to Index Data from Gmail in SearchBlox

Setup Instructions

Task 1 – Create a Database Collection in SearchBlox

Log in to the SearchBlox server via the web interface. Once logged in, adding a collection only takes three clicks.

First, on the SearchBlox admin home screen, click the Add Collection button. The button is located near the top of the screen, just below navigation.

img1

After starting the process of adding a database collection, the next step is to name the collection. SearchBlox collection names are case sensitive and do not allow for either spaces or certain punctuation marks. However, the SearchBlox collection namespace is limited to each server install, which makes naming collections easier. Select Database Collection as the Collection Type.

img2

After naming the collection and selecting Database Collection as the collection type, specify the language or click the Add button. This will add a database collection to the SearchBlox server.

Task 2 – Provide an SQL Query

To fetch data from Gmail, a query must be provided. The query format is shown below.

SELECT as uid , as title, as content FROM LIMIT 100

Example query for Gmail:

SELECT ID as uid, Subject as title, To as description, MessageBody as content FROM Inbox

Reference link:

http://cdn.cdata.com/help/DLA/jdbc/pg_select.htm

img3

If you have more than 100 entries in the inbox, specify the number of documents to be indexed by giving a LIMIT value in the query. For example:

SELECT ID as uid, Subject as title, To as description, MessageBody as content FROM Inbox LIMIT 200

Otherwise, a minimum of 100 rows will be indexed.

Task 3 – Database Collection Settings

Select the database type as Gmail from the dropdown menu.
Enter the database URL string in the format below:
jdbc:gmail:user=myuseraccount@gmail.com;password=mypassword;

Enter the Gmail credentials in the string.

img5

Save the settings.
Check the settings by clicking the Test Database Collection Note that the database connection has to be successful for the indexing to work.
img6

Task 6 – Index and Search

Start indexing from the Index tab or dashboard.

img7

After reaching the maximum number of documents, if continuous indexing is not required, click stop.

Search results in regular search and faceted search are shown as follows:

img8

img9

img10

Task 7 – Viewing Search Result in Kibana

Indexed content from Gmail can be visualized using Kibana.

The example below uses the maximum number of fields available in the data table account. The query to provide is SELECT Headers, Labels, Flags, To, From, Subject FROM Inbox

img11

Steps in Kibana

1. Start Kibana

How to start Kibana?

2. Add the collection ID:

img12

3. After adding the index, the fields mapped can be viewed.

img13

4. Create visualizations by following the steps listed in the reference link, provided in Step 1 above.

A sample visualization generated for Gmail data indexed in SearchBlox:

img14

Back to Top