Mercurial Hosting > luan
comparison lucene/src/luan/modules/lucene/LuceneIndex.java @ 252:3896138955b1
web testing...
git-svn-id: https://luan-java.googlecode.com/svn/trunk@253 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 20 Oct 2014 02:23:00 +0000 |
parents | ef39bc4d3f70 |
children | 4d53e9fc1bd9 |
comparison
equal
deleted
inserted
replaced
251:705d14f4d8ee | 252:3896138955b1 |
---|---|
91 | 91 |
92 LuceneSnapshot openSnapshot() throws IOException { | 92 LuceneSnapshot openSnapshot() throws IOException { |
93 return new LuceneSnapshot(this); | 93 return new LuceneSnapshot(this); |
94 } | 94 } |
95 | 95 |
96 public void delete_all() throws IOException { | |
97 writeLock.lock(); | |
98 try { | |
99 writer.deleteAll(); | |
100 writer.commit(); | |
101 id = idLim = 0; | |
102 } finally { | |
103 writeLock.unlock(); | |
104 } | |
105 } | |
106 | |
96 | 107 |
97 private long id = 0; | 108 private long id = 0; |
98 private long idLim = 0; | 109 private long idLim = 0; |
99 private final int idBatch = 10; | 110 private final int idBatch = 10; |
100 | 111 |
182 tbl.put("fields",fields); | 193 tbl.put("fields",fields); |
183 add( tbl, "to_string" ); | 194 add( tbl, "to_string" ); |
184 add( tbl, "backup", LuanState.class, String.class ); | 195 add( tbl, "backup", LuanState.class, String.class ); |
185 add( tbl, "Writer", LuanState.class, LuanFunction.class ); | 196 add( tbl, "Writer", LuanState.class, LuanFunction.class ); |
186 add( tbl, "Searcher", LuanState.class, LuanFunction.class ); | 197 add( tbl, "Searcher", LuanState.class, LuanFunction.class ); |
198 add( tbl, "delete_all" ); | |
187 } catch(NoSuchMethodException e) { | 199 } catch(NoSuchMethodException e) { |
188 throw new RuntimeException(e); | 200 throw new RuntimeException(e); |
189 } | 201 } |
190 return tbl; | 202 return tbl; |
191 } | 203 } |