// Path: es-tutorial/src/main/java/com/micmiu/es/tutorial/model/User.java
// public class User {
// 
// 	private Long id;
// 
// 	private String name;
// 
// 	private Integer age;
// 
// 	public Integer getAge() {
// 		return age;
// 	}
// 
// 	public void setAge(Integer age) {
// 		this.age = age;
// 	}
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// }


import com.micmiu.es.tutorial.model.User;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.index.query.FilterBuilders;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHits;
import java.io.IOException;
package com.micmiu.es.tutorial;



/**
 * Created
 * User: <a href="http://micmiu.com">micmiu</a>
 * Date: 6/5/2015
 * Time: 12:19
 */
public class EsClient {

	private Client client;

	public void init() {
		client = new TransportClient().addTransportAddress(
				new InetSocketTransportAddress("localhost", 9300));
	}

	public void close() {
		client.close();
	}

	/**
	 * index
	 */
	public void createIndex() {
		for (int i = 0; i < 1000; i++) {
// Path: es-tutorial/src/main/java/com/micmiu/es/tutorial/model/User.java
// public class User {
// 
// 	private Long id;
// 
// 	private String name;
// 
// 	private Integer age;
// 
// 	public Integer getAge() {
// 		return age;
// 	}
// 
// 	public void setAge(Integer age) {
// 		this.age = age;
// 	}
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// }


// Path: es-tutorial/src/main/java/com/micmiu/es/tutorial/EsClient.java
import com.micmiu.es.tutorial.model.User;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.index.query.FilterBuilders;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHits;
import java.io.IOException;

package com.micmiu.es.tutorial;



/**
 * Created
 * User: <a href="http://micmiu.com">micmiu</a>
 * Date: 6/5/2015
 * Time: 12:19
 */
public class EsClient {

	private Client client;

	public void init() {
		client = new TransportClient().addTransportAddress(
				new InetSocketTransportAddress("localhost", 9300));
	}

	public void close() {
		client.close();
	}

	/**
	 * index
	 */
	public void createIndex() {
		for (int i = 0; i < 1000; i++) {
			User user = new User();