Java Code Examples for org.frameworkset.elasticsearch.client.ClientInterface#dropIndice()

The following examples show how to use org.frameworkset.elasticsearch.client.ClientInterface#dropIndice() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PingyinTest.java    From elasticsearch-gradle-example with Apache License 2.0 6 votes vote down vote up
@Test
	public void testCreateDemoMapping(){

		ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("esmapper/estrace/pinyin.xml");
		try {
			//可以先删除索引mapping,重新初始化数据
			clientUtil.dropIndice("demo");
		} catch (ElasticSearchException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


//
		//创建索引表结构
		String response = clientUtil.createIndiceMapping("demo","createDemoIndice");
//       获取并打印创建的索引表结构
		System.out.println(clientUtil.getIndice("demo"));

	}
 
Example 2
Source File: SuggestionTest.java    From elasticsearch-gradle-example with Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateSuggestion(){
	ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("esmapper/estrace/suggest.xml");
	try {
		clientUtil.dropIndice("book");
		String template = clientUtil.createIndiceMapping("book","createCompleteSuggestBookIndice");
		System.out.println(template);

		template = clientUtil.getIndexMapping("book");
		System.out.println(template);


	} catch (ElasticSearchException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
Example 3
Source File: ESTest.java    From bboss-elasticsearch with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetmapping(){
	SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd");
	String date = format.format(new Date());
	ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("estrace/ESTracesMapper.xml");
	System.out.println(clientUtil.getIndice("demo-"+date));
	clientUtil.dropIndice("demo-"+date);
}
 
Example 4
Source File: ESTest.java    From elasticsearch-gradle-example with Apache License 2.0 5 votes vote down vote up
public void testGetmapping(){
	SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd");
	String date = format.format(new Date());
	ClientInterface clientUtil = ElasticSearchHelper.getRestClientUtil();
	System.out.println(clientUtil.getIndice("demo-"+date));
	clientUtil.dropIndice("demo-"+date);
}
 
Example 5
Source File: DocumentCRUD.java    From elasticsearch-gradle-example with Apache License 2.0 5 votes vote down vote up
@Test
public void testCreateIndice(){
	ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("esmapper/demo.xml");
	try {
		//删除mapping
		clientUtil.dropIndice("demo");
	} catch (ElasticSearchException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	//创建mapping
	clientUtil.createIndiceMapping("demo","createDemoIndice");
}
 
Example 6
Source File: ParentChildTest.java    From elasticsearch-gradle-example with Apache License 2.0 5 votes vote down vote up
public void createIndice(){
	ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("esmapper/indexparentchild.xml");
	try {
		//删除mapping
		clientUtil.dropIndice("company");
	} catch (ElasticSearchException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	//创建mapping
	clientUtil.createIndiceMapping("company","createCompanyEmployeeIndice");
}
 
Example 7
Source File: ParentChildTest.java    From elasticsearch-gradle-example with Apache License 2.0 5 votes vote down vote up
public void createClientIndice(){
	ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("esmapper/Client_Info.xml");
	try {
		//删除mapping
		clientUtil.dropIndice("client_info");
	} catch (ElasticSearchException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	//创建mapping
	clientUtil.createIndiceMapping("client_info","createClientIndice");
}
 
Example 8
Source File: PingyinTest.java    From elasticsearch-gradle-example with Apache License 2.0 4 votes vote down vote up
@Test
public void deleteInde(){
	ClientInterface clientUtil = ElasticSearchHelper.getRestClientUtil();
	clientUtil.dropIndice("_all");

}