Mercurial Hosting > luan
comparison src/luan/modules/lucene/LuceneIndex.java @ 1535:e73b72a510b4
Lucene reindex
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 02 Aug 2020 21:30:47 -0600 |
parents | 28f06ac6ce39 |
children | 634f6765830e |
comparison
equal
deleted
inserted
replaced
1534:3289674cc440 | 1535:e73b72a510b4 |
---|---|
257 wrote(); | 257 wrote(); |
258 writeLock.unlock(); | 258 writeLock.unlock(); |
259 } | 259 } |
260 } | 260 } |
261 | 261 |
262 public void reindex(String queryStr) | |
263 throws IOException, ParseException | |
264 { | |
265 Query query = GoodQueryParser.parseQuery(mfp,queryStr); | |
266 | |
267 boolean commit = !writeLock.isHeldByCurrentThread(); | |
268 writeLock.lock(); | |
269 try { | |
270 writer.reindexDocuments("id",query); | |
271 if(commit) writer.commit(); | |
272 } finally { | |
273 wrote(); | |
274 writeLock.unlock(); | |
275 } | |
276 } | |
277 | |
262 public void save(LuanTable doc) | 278 public void save(LuanTable doc) |
263 throws LuanException, IOException, SQLException | 279 throws LuanException, IOException, SQLException |
264 { | 280 { |
265 Object obj = doc.get("id"); | 281 Object obj = doc.get("id"); |
266 Long id; | 282 Long id; |