1

I am new to ES and have read the basic docs online. I started a cluster at QBOX with a restapi - https://...:...@....qb0x.com:309. I want to load some data uisng a Java backend and then be able to access it. I am a bit lost in so many ways of using ES and I would appreciate a code sample. I have ubuntu on my backend.

I tried this -

    UpdateRequest updateRequest = new UpdateRequest();
    updateRequest.index("index");
    updateRequest.type("type");
    updateRequest.id("1");
    updateRequest.doc(jsonBuilder()
            .startObject()
                .field("gender", "male")
            .endObject());
    client.update(updateRequest).get();

    IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
            .setSource(jsonBuilder()
                        .startObject()
                            .field("user", "kimchy")
                            .field("postDate", new Date())
                            .field("message", "trying out Elasticsearch")
                        .endObject()
                      )
            .get();

This was just to see what could work but I have compile errors and I have no idea really how to code the actual restapi.

My app is to add a search engine my site and I think ES has an automatic indexing system to allow word searches, hence ES will not be implemented at my site and I will use results from a call to the API to display at my site.

Any help appreciated.

Trevor Oakley
  • 438
  • 5
  • 17
  • Actually I have made some progress but slowly. When I have an answer I will post it. I have found skills in ES are rare. – Trevor Oakley Feb 09 '16 at 11:17
  • http://stackoverflow.com/questions/35355957/elasticsearch-and-connections-to-qbox-error This post answers the key issues. – Trevor Oakley Feb 13 '16 at 09:30

0 Answers0