2627282930313233343536
@Test public void testReader() throws Exception { int hits = 1; Directory gaeDir = new DataStoreDirectory(); String[] texts = { "Lucene in Action" }; TestUtils.write(gaeDir, texts);
4344454647484950515253
@Test public void testReader2() throws Exception { int hits = 3; Directory gaeDir = new DataStoreDirectory(); String[] texts = { "Lucene in Action", "How Lucene Works", "Another Directory of Lucene" }; TestUtils.write(gaeDir, texts);
3435363738394041424344
} @Test public void testClean() throws Exception { Directory dir = new DataStoreDirectory("teste"); IndexTool tool = new IndexTool(dir); tool.clean();
93949596979899100101102103
} @Test public void testOptimize() throws Exception { Directory dir = new DataStoreDirectory("teste"); IndexTool tool = new IndexTool(dir); tool.optimize(TestUtils.getWriterConfig());
104105106107108109110111112113114
} @Test public void testOptimizeAndClean() throws Exception { Directory dir = new DataStoreDirectory("teste"); IndexTool tool = new IndexTool(dir); tool.optimizeAndClean(TestUtils.getWriterConfig());
171819202122232425262728
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { int index = getIndex(); String name = LuceneUtils.getNameForDirectory(index); DataStoreDirectory directory = new DataStoreDirectory(name); directory.cleanFiles(); System.out.println("Index=" + index); }
3233343536373839404142
if (key != null) { String name = LuceneUtils.getNameForDirectory(index); DataStoreDirectory directory = new DataStoreDirectory(name); IndexTool tool = new IndexTool(directory); BlobstoreInputStream in = new BlobstoreInputStream(key);
2223242526272829303132
if (index != null) { String name = LuceneUtils.getNameForDirectory(index); DataStoreDirectory directory = new DataStoreDirectory(name); IndexTool tool = new IndexTool(directory); resp.setContentType("application/zip");
212223242526272829303132
if (index != null) { String name = LuceneUtils.getNameForDirectory(index); DataStoreDirectory directory = new DataStoreDirectory(name); directory.deleteFiles(); } }