Model model = ModelFactory.createDefaultModel();
model.register(indexBuilder) ;
model.add(model.createResource("http://example/r1"), model.createProperty("http://example/p"), model.createLiteral("foo"));
model.add(model.createResource("http://example/r2"), model.createProperty("http://example/p"), model.createLiteral("foo"));
model.removeAll(model.getResource("http://example/r1"), model.getProperty("http://example/p"), model.createLiteral("foo"));
IndexLARQ index = indexBuilder.getIndex() ;
assertTrue(index.searchModelByIndex("foo").hasNext()) ; // the Model is used as reference counting, still one literal "foo" is present in the Lucene index
model.removeAll(model.getResource("http://example/r2"), model.getProperty("http://example/p"), model.createLiteral("foo"));
index = indexBuilder.getIndex() ;