Could not find commonTermsQuery api for elasticsearch5.1.1

it could not find commonTermsQuery api for elasticsearch5.1.1, detail below:
//set cluster name
Settings settings = Settings.builder().put("", "es5-cluster").build();
TransportClient client = new PreBuiltTransportClient(settings)
new InetSocketTransportAddress(InetAddress.getByName(""), 9300));//

//it could not find below api
QueryBuilder qb = commonTermsQuery("name","kimchy");

already added dependcy in pom.xml:


<!-- -->

please help, thanks~~~


commonTermsQuery() is a static helper method in org.elasticsearch.index.query.QueryBuilders. So either import QueryBuilders and then do QueryBuilders.commonTermsQuery("name","kimchy"); or do a static import and you can ommit the class. Hope that helps.

hi, thanks your reply, it may fix my question^_^.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.