The IBM Cloud is the cloud for smarter business.
The getting started tutorial uses the searchly-nodejs-sample sample app to demonstrate how to use Node.js to connect to an Searchly Elasticsearch service.
A valid IBM Cloud account and need to install Node.js and Git.
You can create a service instance from the Searchly in the IBM Cloud catalog.
Clone the Nodejs sample application from Github
git clone https://github.com/searchly/searchly-nodejs-sample
Use npm to install dependencies.
cd searchly-nodejs-sample
package.json
file. npm install
The IBM Cloud CLI tool is used for communicating IBM Cloud from your terminal or command line. Please see Download and Install.
ibmcloud login
ibmcloud target --cf
manifest.yml
to associate an application with a service.
---
applications:
- name: searchly-elasticsearch-nodejs-sample
host: searchly-elasticsearch-nodejs-sample
memory: 64M
services:
- searchly-service-name
host
value to unique. It will translate to <host>.mybluemix.net
.name
value. The value you choose will be the name of the app as it appears in your IBM Cloud dashboard.services
value to match the name of the service you created in Create a Searchly service instance.When you push the app it will automatically be bound to the service specified in the manifest file.
ibmcloud cf push
Now, when you visit <host>.mybluemix.net/
you will see index page of sample applicaiton.
To create initial index and sample data click Create Sample Index & Data!
.
Type "John"
or "Robert"
to search box and hit enter for sample search results.
Ensure to check official Nodejs Elasticsearch client documentation at Elastic.