use of org.exist.xmldb.IndexQueryService in project exist by eXist-db.
the class InteractiveClient method reindex.
private void reindex() throws XMLDBException {
final IndexQueryService service = (IndexQueryService) current.getService("IndexQueryService", "1.0");
message("reindexing collection " + current.getName());
service.reindexCollection();
messageln("done.");
}
use of org.exist.xmldb.IndexQueryService in project exist by eXist-db.
the class OptimizerTest method initDatabase.
@BeforeClass
public static void initDatabase() throws ClassNotFoundException, IllegalAccessException, InstantiationException, XMLDBException, IOException, URISyntaxException {
// initialize driver
Class<?> cl = Class.forName("org.exist.xmldb.DatabaseImpl");
Database database = (Database) cl.newInstance();
database.setProperty("create-database", "true");
DatabaseManager.registerDatabase(database);
Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
testCollection = service.createCollection("test");
Assert.assertNotNull(testCollection);
IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
idxConf.configureCollection(COLLECTION_CONFIG);
XMLResource resource = (XMLResource) testCollection.createResource("test.xml", "XMLResource");
resource.setContent(XML);
testCollection.storeResource(resource);
for (final String sampleName : SAMPLES.getShakespeareXmlSampleNames()) {
resource = (XMLResource) testCollection.createResource(sampleName, XMLResource.RESOURCE_TYPE);
try (final InputStream is = SAMPLES.getShakespeareSample(sampleName)) {
resource.setContent(InputStreamUtil.readString(is, UTF_8));
}
testCollection.storeResource(resource);
}
}
use of org.exist.xmldb.IndexQueryService in project exist by eXist-db.
the class ValueIndexTest method configureCollection.
/**
* @throws XMLDBException
*/
protected void configureCollection(String config) throws XMLDBException {
IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
idxConf.configureCollection(config);
}
use of org.exist.xmldb.IndexQueryService in project exist by eXist-db.
the class CollectionTriggerTest method createTestCollection.
@Before
public void createTestCollection() throws XMLDBException {
// create a test collection
testCollection = rootSrv.createCollection(TEST_COLLECTION);
// configure the test collection with the trigger
IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
idxConf.configureCollection(COLLECTION_CONFIG);
}
use of org.exist.xmldb.IndexQueryService in project exist by eXist-db.
the class SAXTriggerTest method saxEventModificationsAtXConf.
@Test
public void saxEventModificationsAtXConf() throws EXistException, XMLDBException {
final Collection root = DatabaseManager.getCollection(BASE_URI + testCollection, "admin", "");
final IndexQueryService idxConf = (IndexQueryService) root.getService("IndexQueryService", "1.0");
idxConf.configureCollection(COLLECTION_CONFIG);
Resource resource = root.createResource("data.xml", "XMLResource");
resource.setContent(DOCUMENT2_CONTENT);
root.storeResource(resource);
resource = root.createResource("data.xml", "XMLResource");
assertEquals(DOCUMENT3_CONTENT, resource.getContent().toString());
}
Aggregations