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?

  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");}   

Before Location < / Div>

To add a document to your < bulkRequest index.

Please add the following to your GetResponse .

  BulkResponse bulkResponse = bulkRequest.execute (). Actiongate ();   

You can test the properties on the bulkResponse object to successfully complete it.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -