Page last updated:

Search made simple.

Managing Services

Managing services from the command line

Using Service Instances with your Application

See Delivering Service Credentials to an Application and VCAP_SERVICES Environment Variable.

Format of credentials in VCAP_SERVICES environment variable.

  searchly: [
      name: "searchly-1",
      label: "searchly",
      tags: [ ],
      plan: "starter",
      credentials: {
        uri: "",
        sslUri: ""


Jest is a Java HTTP Rest client for ElasticSearch.It is actively developed and tested by Searchly.


Ensure you have added Sonatype repository to your pom.xml

     <name>Sonatype Groups</name>

With Maven add Jest dependency to your pom.xml


Install Jest via Maven

$ mvn clean install


Create a Jest Client Bean:

public class SpringConfiguration {

    public JestClient jestClient() throws Exception {

        // Using jackson to parse VCAP_SERVICES
        Map result = new ObjectMapper().readValue(System.getenv("VCAP_SERVICES"), HashMap.class);

        String connectionUrl = (String) ((Map) ((Map) ((List)
        // Configuration
        ClientConfig clientConfig = new ClientConfig.Builder(connectionUrl).multiThreaded(true).build();

        // Construct a new Jest client according to configuration via factory
        JestClientFactory factory = new JestClientFactory();
        return factory.getObject();


Create an index via Jest with ease;

client.execute(new CreateIndex.Builder("articles").build());

Create new document.

Article source = new Article();
source.setAuthor("John Ronald Reuel Tolkien");
source.setContent("The Lord of the Rings is an epic high fantasy novel");

Index article to “articles” index with “article” type.

Index index = new Index.Builder(source).index("articles").type("article").build();


Search queries can be either JSON String or ElasticSearch SearchSourceBuilder object (You need to add ElasticSearch dependency for SearchSourceBuilder).

String query = "{\n" +
    "    \"query\": {\n" +
    "        \"filtered\" : {\n" +
    "            \"query\" : {\n" +
    "                \"query_string\" : {\n" +
    "                    \"query\" : \"Lord\"\n" +
    "                }\n" +
    "            }\n"+
    "        }\n" +
    "    }\n" +

Search search = (Search) new Search.Builder(query)
// multiple index or types can be added.

List<Article> result = client.getSourceAsObjectList(Article.class);

Jest has very detailed documentation at it’s github page.



Ruby on Rails applications will need to add the following entry into their Gemfile.

gem 'tire'

Update application dependencies with bundler. shell $ bundle install Configure Tire in configure/application.rb or configure/environment/production.rb

# top of Application.configure
require 'json'

Tire.configure do
    url JSON.parse(ENV['VCAP_SERVICES']['searchly'][0]['credentials']['uri'])

Make your model searchable:

class Document < ActiveRecord::Base
  include Tire::Model::Search
  include Tire::Model::Callbacks

When you now save a record:

Document.create :name => "Cost",
               :text => "Cost is claimed to be reduced and in a public cloud delivery model capital expenditure is converted."

The included callbacks automatically add the document to a documents index, making the record searchable:

@documents = 'Cost'

Tire has very detailed documentation at it’s github page.


elasticsearchclient is a lightweight ElasticSearch client for Node.js. It is actively developed and covers core modules of ElasticSearch.


Add elasticsearchclient dependency to your package.json file and use npm to install your dependencies

"dependencies": {

Create a search client:

var ElasticSearchClient = require('elasticsearchclient'),
url = require('url');

var connectionString = url.parse(JSON.parse(process.env.VCAP_SERVICES)['searchly'][0]['credentials']['uri']);

var serverOptions = {
    host: connectionString.hostname,
    port: connectionString.port,
    secure: false,
    auth: {
        username: connectionString.auth.split(":")[0],
        password: connectionString.auth.split(":")[1]

var elasticSearchClient = new ElasticSearchClient(serverOptions);

Index a document

elasticSearchClient.index('sample', 'document', {'name':'Reliability', 'text':'Reliability is improved', id:"1"})
    .on('data', function(data) {

Create a query and search it

var qryObj = {
};'sample', 'document', qryObj)
    .on('data', function (data) {
    }).on('error', function (error) {

Sample Applications


Though our dashboard, you can get your connection information and api-key, create access keys for scoping indices or public only accesses, check your limitation, create crawlers, and get graphical information of your search analytics.



Contacting Service Providers for Support