elastic map reduce - bulk indexing in elasticsearch issue -
I'm trying to index a file using code below: but I'm thinking Why is this not happening: Does any body explain the reason for indexing? Before Location < / Div> To add a document to your < Please add the following to your You can test the properties on the
Public static zero main (string [] args throws IOException {string line; List L = New Arrestist (); FileReader file = new FileReader ("test.txt"); BufferedReader br = new BufferedReader (file); While ((line = br.readline ()) = null {l.add (line);} br.close (); println (l); client client = new transportclient (). AddTransportAddress (New InetSocketTransportAddress ("10.210. BulkRequestbuilder bulkRequest = client.prepareBulk (); // Create either client use #, or use requests directly to create index / delete requests Iterator = l.iterator (); while (( It hasNext ()) {string name = (string) it.next (); bulkRequest.add (client.prepareIndex ("cricket", "crick", "1") .setSource (jsonbuilder () .startObject () .field ("User", name) .field ("POS Date "(" Message "," Buckle INSERT Test ") .endObject ());} GetResponse getResponse = client.prepareGet (" Cricket "," Crick "," 1 "). ActionGet (); PrintLn (getResponse.getSourceAsString ()); System.out.println ("Bulk Request Ended");}
bulkRequest index.
GetResponse .
BulkResponse bulkResponse = bulkRequest.execute (). Actiongate ();
bulkResponse object to successfully complete it.
Comments
Post a Comment