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.