Package org.elasticsearch.action.admin.indices.exists.indices

Examples of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest


            createRiver();
            Thread.sleep(wait);

            ActionFuture<IndicesExistsResponse> response = getNode().client().admin().indices()
                    .exists(new IndicesExistsRequest(getIndex()));
            assertThat(response.actionGet().isExists(), equalTo(true));
            refreshIndex();
            assertThat(getNode().client().count(countRequest(getIndex())).actionGet().getCount(), equalTo(1l));

            deleteRiver();
View Full Code Here


            String mongoDocument = copyToStringFromClasspath(TEST_SIMPLE_MONGODB_DOCUMENT_JSON);
            DBObject dbObject = (DBObject) JSON.parse(mongoDocument);
            mongoCollection.insert(dbObject);
            Thread.sleep(wait);

            assertThat(getNode().client().admin().indices().exists(new IndicesExistsRequest(index)).actionGet().isExists(), equalTo(true));

            refreshIndex(index);

            CountResponse countResponse = getNode().client().count(countRequest(index)).actionGet();
            assertThat(countResponse.getCount(), equalTo(0L));

            mongoCollection.remove(dbObject);

            // Wait 5 seconds and store a new document
            Thread.sleep(5000);

            dbObject = (DBObject) JSON.parse(mongoDocument);
            mongoCollection.insert(dbObject);
            Thread.sleep(wait);

            assertThat(getNode().client().admin().indices().exists(new IndicesExistsRequest(index)).actionGet().isExists(), equalTo(true));
            assertThat(getNode().client().admin().indices().prepareTypesExists(index).setTypes(getDatabase()).execute().actionGet()
                    .isExists(), equalTo(true));

            refreshIndex(index);
View Full Code Here

            String mongoDocument = copyToStringFromClasspath(TEST_SIMPLE_MONGODB_DOCUMENT_JSON);
            DBObject dbObject = (DBObject) JSON.parse(mongoDocument);
            mongoCollection.insert(dbObject);
            Thread.sleep(wait);

            assertThat(getNode().client().admin().indices().exists(new IndicesExistsRequest(index)).actionGet().isExists(), equalTo(true));

            refreshIndex(index);

            CountResponse countResponse = getNode().client().count(countRequest(index)).actionGet();
            assertThat(countResponse.getCount(), equalTo(0L));

            mongoCollection.remove(dbObject);

            // Wait 5 seconds and store a new document
            Thread.sleep(5000);

            dbObject = (DBObject) JSON.parse(mongoDocument);
            mongoCollection.insert(dbObject);
            Thread.sleep(wait);

            assertThat(getNode().client().admin().indices().exists(new IndicesExistsRequest(index)).actionGet().isExists(), equalTo(true));
            assertThat(getNode().client().admin().indices().prepareTypesExists(index).setTypes(getDatabase()).execute().actionGet()
                    .isExists(), equalTo(true));

            refreshIndex(index);
View Full Code Here

            createRiver();
            Thread.sleep(wait);

            // Check that it did an initial import successfully
            ActionFuture<IndicesExistsResponse> response = getNode().client().admin().indices()
                    .exists(new IndicesExistsRequest(getIndex()));
            assertThat(response.actionGet().isExists(), equalTo(true));
            assertThat(getNode().client().count(countRequest(getIndex())).actionGet().getCount(), equalTo(1l));
            assertThat(MongoDBRiverHelper.getRiverStatus(getNode().client(), getRiver()), equalTo(Status.RUNNING));

            MongoDBRiverDefinition definition = getMongoDBRiverDefinition(TEST_MONGODB_RIVER_SIMPLE_JSON, getDatabase(), getCollection(),
View Full Code Here

            WriteResult result1 = mongoCollection.insert(dbObject1);
            logger.info("WriteResult: {}", result1.toString());
            Thread.sleep(wait);

            ActionFuture<IndicesExistsResponse> response = getNode().client().admin().indices()
                    .exists(new IndicesExistsRequest(getIndex()));
            assertThat(response.actionGet().isExists(), equalTo(true));
            refreshIndex();
            assertThat(getNode().client().count(countRequest(getIndex())).actionGet().getCount(), equalTo(1l));

            assertThat(getNode().client().admin().indices().prepareExists(storeStatsIndex).get().isExists(), equalTo(true));
View Full Code Here

            WriteResult result = mongoCollection.insert(dbObject);
            Thread.sleep(wait);
            String id = dbObject.get("_id").toString();
            logger.info("WriteResult: {}", result.toString());
            ActionFuture<IndicesExistsResponse> response = getNode().client().admin().indices()
                    .exists(new IndicesExistsRequest(getIndex()));
            assertThat(response.actionGet().isExists(), equalTo(true));
            refreshIndex();
            SearchRequest search = getNode().client().prepareSearch(getIndex()).setQuery(new QueryStringQueryBuilder("Richard").defaultField("name"))
                    .request();
            SearchResponse searchResponse = getNode().client().search(search).actionGet();
View Full Code Here

            dbObject.put("include-field-2", System.currentTimeMillis());
            dbObject.put("field-3", System.currentTimeMillis());
            mongoCollection.insert(dbObject);
            Thread.sleep(wait);
            String id = dbObject.get("_id").toString();
            assertThat(getNode().client().admin().indices().exists(new IndicesExistsRequest(getIndex())).actionGet().isExists(),
                    equalTo(true));
            refreshIndex();

            SearchResponse sr = getNode().client().prepareSearch(getIndex()).setQuery(QueryBuilders.queryString(id).defaultField("_id"))
                    .execute().actionGet();
View Full Code Here

            dbObject.put("exclude-field-2", System.currentTimeMillis());
            dbObject.put("include-field-1", System.currentTimeMillis());
            mongoCollection.insert(dbObject);
            Thread.sleep(wait);
            String id = dbObject.get("_id").toString();
            assertThat(getNode().client().admin().indices().exists(new IndicesExistsRequest(getIndex())).actionGet().isExists(),
                    equalTo(true));
            refreshIndex();

            SearchResponse sr = getNode().client().prepareSearch(getIndex()).setQuery(QueryBuilders.queryString(id).defaultField("_id"))
                    .get();
View Full Code Here

            String mongoDocument = copyToStringFromClasspath(TEST_SIMPLE_MONGODB_DOCUMENT_JSON);
            DBObject dbObject = (DBObject) JSON.parse(mongoDocument);
            mongoCollection.insert(dbObject);
            Thread.sleep(wait);

            assertThat(getNode().client().admin().indices().exists(new IndicesExistsRequest(getIndex())).actionGet().isExists(),
                    equalTo(true));
            assertThat(getNode().client().admin().indices().prepareTypesExists(getIndex()).setTypes(getDatabase()).execute().actionGet()
                    .isExists(), equalTo(true));

            String collectionName = mongoCollection.getName();
View Full Code Here

     * @param indices The indices to check if they exists or not.
     * @return The indices exists request
     * @see org.elasticsearch.client.IndicesAdminClient#exists(org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest)
     */
    public static IndicesExistsRequest indicesExistsRequest(String... indices) {
        return new IndicesExistsRequest(indices);
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.