Java Code Examples for org.elasticsearch.client.indices.GetIndexRequest#local()

The following examples show how to use org.elasticsearch.client.indices.GetIndexRequest#local() . 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: EsUtil.java    From bookmark with MIT License 5 votes vote down vote up
/**
 * Description: 判断某个index是否存在
 *
 * @param index index名
 * @return boolean
 * @author fanxb
 * @date 2019/7/24 14:57
 */
public boolean indexExist(String index) throws Exception {
    if (!status) {
        return false;
    }
    GetIndexRequest request = new GetIndexRequest(index);
    request.local(false);
    request.humanReadable(true);
    request.includeDefaults(false);
    return client.indices().exists(request, RequestOptions.DEFAULT);
}
 
Example 2
Source File: EsUtil.java    From demo-project with MIT License 3 votes vote down vote up
/**
 * Description: 判断某个index是否存在
 *
 * @param index index名
 * @return boolean
 * @author fanxb
 * @date 2019/7/24 14:57
 */
public boolean indexExist(String index) throws Exception {
    GetIndexRequest request = new GetIndexRequest(index);
    request.local(false);
    request.humanReadable(true);
    request.includeDefaults(false);
    return client.indices().exists(request, RequestOptions.DEFAULT);
}