Mercurial Hosting > luan
diff 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 |
line wrap: on
line diff
--- a/src/luan/modules/lucene/LuceneIndex.java Sun Aug 02 21:21:35 2020 -0600 +++ b/src/luan/modules/lucene/LuceneIndex.java Sun Aug 02 21:30:47 2020 -0600 @@ -259,6 +259,22 @@ } } + public void reindex(String queryStr) + throws IOException, ParseException + { + Query query = GoodQueryParser.parseQuery(mfp,queryStr); + + boolean commit = !writeLock.isHeldByCurrentThread(); + writeLock.lock(); + try { + writer.reindexDocuments("id",query); + if(commit) writer.commit(); + } finally { + wrote(); + writeLock.unlock(); + } + } + public void save(LuanTable doc) throws LuanException, IOException, SQLException {