IBM Cloud


The IBM Cloud is the cloud for smarter business.

Getting started tutorial

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.

  1. Enter the sample app directory
  cd searchly-nodejs-sample
  1. Install the dependencies listed in the 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.

  1. Connect to IBM Cloud in the command line tool and log in.
  ibmcloud login
  1. Make sure you are targetting the correct IBM Cloud org and space.
  ibmcloud target --cf

manifest.yml to associate an application with a service.

  1. Sample application
  ---
  applications:
  - name:    searchly-elasticsearch-nodejs-sample
    host:    searchly-elasticsearch-nodejs-sample
    memory:  64M
    services:
      - searchly-service-name
  1. Change the host value to unique. It will translate to <host>.mybluemix.net.
  2. Change the name value. The value you choose will be the name of the app as it appears in your IBM Cloud dashboard.
  3. Update the 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
  1. Navigate to your Searchly service dashboard
  2. Select Connections from the dashboard menu. Your application should be listed under Connected Applications.

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.