public  void backupDoc(String indexName) throws Exception{
		File file = new File(configService.getBackupDataFilePath(indexName));
		JsonFactory jfactory = new JsonFactory();  
	    /*** write to file ***/  
	    JsonGenerator jGenerator = jfactory.createGenerator(file, JsonEncoding.UTF8);  
		long startTime = System.currentTimeMillis();
		Client esClient = configService.getBackupClient();
		SearchResponse searchResponse = esClient.prepareSearch(indexName)
				// 加上这个据说可以提高性能，但第一次却不返回结果
				.setSearchType(SearchType.SCAN)
				// 实际返回的数量为5*index的主分片格式
				.setSize(1000)
				// 这个游标维持多长时间
				.setScroll(TimeValue.timeValueMinutes(10000))
				.execute().actionGet();
		if(searchResponse.getScrollId() != null){
			// 第一次查询，只返回数量和一个scrollId
			long docCount = searchResponse.getHits().getTotalHits();
			long fetchCount = 0;
			logger.info("{} documents count:{}" , indexName,docCount);
			if(docCount==0){
				/**
				 * 无数据
				 */
				logger.info("{} no data",indexName);
				return ;
			}
			int failedCount=0;
			while (fetchCount < docCount && failedCount<3) {
				// 只要取不够，一直取
				// 使用上次的scrollId继续访问
				searchResponse = esClient
						.prepareSearchScroll(searchResponse.getScrollId())
						.setScroll(TimeValue.timeValueMinutes(8)).execute()
						.actionGet();
				if(searchResponse.getHits().hits().length==0){
					failedCount++;
				}
				else {
					fetchCount += searchResponse.getHits().hits().length;
					
					for (SearchHit hit : searchResponse.getHits()) {
						jGenerator.writeStartObject();
						
						String indexNm=hit.getIndex();
						jGenerator.writeStringField(Tag.INDEX_NAME_TAG, indexNm); // 
						String typeNm=hit.getType();
						jGenerator.writeStringField(Tag.TYPE_NAME_TAG, typeNm); // 
						String docId = hit.getId();
						jGenerator.writeStringField(Tag.DOC_ID_TAG, docId); // 
						String doc = hit.getSourceAsString();
						jGenerator.writeStringField(Tag.SOURCE_TAG, doc); // 
						jGenerator.writeEndObject();
						jGenerator.writeRaw("\n");
					}
					
					if (fetchCount % 1000 == 0) {
						logger.info("{}  backup document count:{}",indexName,fetchCount);
					}
				}
			}
			jGenerator.flush();
			jGenerator.close();
			logger.info("{} backup count:{}" ,indexName,fetchCount);
			logger.debug("{} backup useTime:{}",indexName, (System.currentTimeMillis() - startTime));
		}
		else {
			/**
			 * 未获得scrollId
			 * TODO
			 */
		}
	}