@Override public void addIndex(final String newIndexName,final int shards,final int replicas, final String writeConsistency){ managerCache.getEntityIndex(applicationScope).addIndex(newIndexName, shards, replicas, writeConsistency); }
@Test public void testAddMultipleIndexes() throws IOException { final String entityType = "thing"; IndexEdge searchEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE, 10 ); final SearchTypes searchTypes = SearchTypes.fromTypes(entityType); insertJsonBlob( entityType, searchEdge, "/sample-large.json", 101, 0); testQueries(searchEdge, searchTypes); entityIndex.addIndex(UUID.randomUUID()+"_v2", 1, 0, "one"); insertJsonBlob( entityType, searchEdge, "/sample-large.json", 101, 100); //Hilda Youn testQuery( searchEdge, searchTypes, "name = 'Hilda Young'", 1 ); testQuery( searchEdge, searchTypes, "name = 'Lowe Kelley'", 1 ); logger.info("hi"); }
@Test public void testDeleteWithAlias() throws IOException { final String entityType = "thing"; IndexEdge searchEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE, 1 ); final SearchTypes searchTypes = SearchTypes.fromTypes( entityType ); insertJsonBlob( entityType, searchEdge, "/sample-large.json", 1, 0 ); entityIndex.addIndex(UUID.randomUUID() + "v2", 1, 0, "one"); entityIndex.refreshAsync().toBlocking().first(); insertJsonBlob( entityType, searchEdge, "/sample-large.json", 1, 1 ); CandidateResults crs = testQuery( searchEdge, searchTypes, "name = 'Bowers Oneil'", 1 ); EntityIndexBatch entityIndexBatch = entityIndex.createBatch(); entityIndexBatch.deindex(searchEdge, crs.get(0)); indexProducer.put(entityIndexBatch.build()).subscribe(); entityIndex.refreshAsync().toBlocking().first(); //Hilda Youn testQuery(searchEdge, searchTypes, "name = 'Bowers Oneil'", 0); }