Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

24.7. Filter 過濾

		
FilterBuilder filterBuilder = FilterBuilders.andFilter(  
	FilterBuilders.existsFilter("title").filterName("exist"),  
	FilterBuilders.termFilter("title", "elastic")  
);  

SearchResponse response = client.prepareSearch("netkiller")  
	.setPostFilter(filterBuilder)  
	.get();  
		
		

24.7.1. term

			
.setPostFilter(QueryBuilders.termQuery("site_id", siteId))
			
			

24.7.2. range

			
QueryBuilders.rangeQuery("age").from(12).to(18)