Examples of IndicesExistsRequest


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

            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();
            long countRequest = getNode().client().count(countRequest(getIndex())).actionGet().getCount();
            mongoCollection.drop();
            Thread.sleep(wait);
            assertThat(mongoDB.collectionExists(collectionName), equalTo(false));
            Thread.sleep(wait);
            refreshIndex();
            if (!dropCollectionOption) {
                countRequest = getNode().client().count(countRequest(getIndex())).actionGet().getCount();
                assertThat(countRequest, greaterThan(0L));
            } else {
                countRequest = getNode().client().count(countRequest(getIndex())).actionGet().getCount();
                assertThat(countRequest, equalTo(0L));
            }
            dbObject = (DBObject) JSON.parse(mongoDocument);
            String value = String.valueOf(System.currentTimeMillis());
            dbObject.put("attribute1", value);
            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));
            CountResponse countResponse = getNode().client().prepareCount(getIndex())
                    .setQuery(QueryBuilders.queryString(value).defaultField("attribute1")).get();
View Full Code Here

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

            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));
            long countRequest = getNode().client().count(countRequest(getIndex())).actionGet().getCount();
            mongoDB.dropDatabase();
            Thread.sleep(wait);
            assertThat(databaseExists(getDatabase()), equalTo(false));
            Thread.sleep(wait);
            refreshIndex();

            if (!dropCollectionOption) {
                countRequest = getNode().client().count(countRequest(getIndex())).actionGet().getCount();
                assertThat(countRequest, greaterThan(0L));
            } else {
                countRequest = getNode().client().count(countRequest(getIndex())).actionGet().getCount();
                assertThat(countRequest, equalTo(0L));
            }
            mongoDB = getMongo().getDB(getDatabase());
            mongoCollection = mongoDB.createCollection(getCollection(), null);
            dbObject = (DBObject) JSON.parse(mongoDocument);
            String value = String.valueOf(System.currentTimeMillis());
            dbObject.put("attribute1", value);
            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));
            CountResponse countResponse = getNode().client().prepareCount(getIndex())
                    .setQuery(QueryBuilders.queryString(value).defaultField("attribute1")).get();
View Full Code Here

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

            WriteResult result = mongoCollection.insert(dbObject);
            Thread.sleep(wait);
            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

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

            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(QueryBuilders.queryString("Richard").defaultField("name"))
                    .request();
            SearchResponse searchResponse = getNode().client().search(search).actionGet();
View Full Code Here

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

            createRiver(filter);
            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));
        } catch (Throwable t) {
            logger.error("CollectionFilter failed.", t);
View Full Code Here

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

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

            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

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

            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

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

            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

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

            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
TOP
Copyright © 2018 www.massapi.com. 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.