public void testIndexCSVBigHTTP() throws Exception {
  createIndex();
  send("registerFields","{fields: {id: {type: atom, store: true, sort: true}, id2: {type: atom, store: true, sort: true}, body: {type: text, store: true, highlight: true}}}");
  send("startIndex");
  StringBuilder b=new StringBuilder();
  int size=atLeast(512);
  for (int i=0; i < 256 * size; i++) {
    b.append("wordy ");
  }
  b.append(" document");
  String body=b.toString();
  assertTrue(body.length() > 512 * 1024);
  Map<String,Object> params=new HashMap<>();
  params.put("indexName",server.curIndexName);
  JSONObject result=server.send("bulkCSVAddDocument2",params,new StringReader("id,id2,body\n0,1," + body + "\n"));
  assertEquals(1,getInt(result,"indexedDocumentCount"));
  refresh();
  assertEquals(1,getInt(send("search","{queryText: document}"),"totalHits"));
  send("stopIndex");
  send("deleteIndex");
}

public void testIndexCSVBigHTTP ( ) throws Exception { createIndex ( ) ; send ( "registerFields" , "{fields: {id: {type: atom, store: true, sort: true}, id2: {type: atom, store: true, sort: true}, body: {type: text, store: true, highlight: true}}}" ) ; send ( "startIndex" ) ; StringBuilder b = new StringBuilder ( ) ; int size = atLeast ( 512 ) ; for ( int i = 0 ; i < 256 * size ; i ++ ) { b . append ( "wordy " ) ; } b . append ( " document" ) ; String body = b . toString ( ) ; assertTrue ( body . length ( ) > 512 * 1024 ) ; Map < String , Object > params = new HashMap < > ( ) ; params . put ( "indexName" , server . curIndexName ) ; JSONObject result = server . send ( "bulkCSVAddDocument2" , params , new StringReader ( "id,id2,body\n0,1," + body + "\n" ) ) ; assertEquals ( 1 , getInt ( result , "indexedDocumentCount" ) ) ; refresh ( ) ; assertEquals ( 1 , getInt ( send ( "search" , "{queryText: document}" ) , "totalHits" ) ) ; send ( "stopIndex" ) ; send ( "deleteIndex" ) ; }
index a document via csv that ' s larger than the 512 kb chunk size
