Example of connecting to ElasticSearch using BIRT with a Scripted Data Set
Clement Wong
E mod
Here is a very simple example of BIRT connecting to ElasticSearch using a Scriped Data Set. This could also illustrate connecting to a REST based data source with a JSON result set.<br />
<br />
The three events were added:<br />
<br />
<br />
<br />
Place the helper JavaScript, “json.jsâ€, into the root of the project folder.<br />
<br />
Note: If you are using BIRT 4.5.0, it has built-in JSON support so you don't need the helper JavaScript file, "json.js", in the root of your project folder. The difference between the two designs in the ZIP is that the one for pre-BIRT 4.5.0, there is an external Resources reference to "json.js", and the one for 4.5.0 does not have it. If you don't have it in pre-BIRT 4.5.0, when attempting to run the report, you will see an error like ... ReferenceError: "JSON" is not defined.
<br />
The three events were added:<br />
<br />
Data Source > Open
<br />
Make a query request to ElasticSearch<br />
Save the results in a JSON variable
<br />
Save the results in a JSON variable
<br />
Data Set > Open
<br />
Data Set > Open
Reset the row counter to zero
<br />
<br />
Data Set > Fetch
<br />
Data Set > Fetch
Create a row of data from ElasticSearch for each “hitâ€<br />
Set the output column field values from the JSON result set<br />
Stop when total hits are reached
<br />Set the output column field values from the JSON result set<br />
Stop when total hits are reached
<br />
<br />
Place the helper JavaScript, “json.jsâ€, into the root of the project folder.<br />
<br />
Note: If you are using BIRT 4.5.0, it has built-in JSON support so you don't need the helper JavaScript file, "json.js", in the root of your project folder. The difference between the two designs in the ZIP is that the one for pre-BIRT 4.5.0, there is an external Resources reference to "json.js", and the one for 4.5.0 does not have it. If you don't have it in pre-BIRT 4.5.0, when attempting to run the report, you will see an error like ... ReferenceError: "JSON" is not defined.
Warning
No formatter is installed for the format ipb
0
Comments
-
@Clement Wong when I downloaded attached file, it is not a zip file, but a ipb file. Could you attache the zip file, your help is appreciated.
0 -
@birtCubes Looks like there is an issue with the migration of the attachments. For now, if you download the .IPB file, you can rename the extension to .ZIP and open it up correctly. I just tried it now.
Warning No formatter is installed for the format ipb0 -
@Clement Wong yes, it works. thanks a lot!
0
Categories
- All Categories
- 107 Developer Announcements
- 53 Articles
- 104 General Questions
- 141 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 76 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 118 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management