comparison lucene/src/luan/modules/lucene/LuceneIndex.java @ 617:e54c1646eed0

add Lucene.next_id()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 30 Dec 2015 02:15:01 -0700
parents d36027b41570
children 5e495e4e560b
comparison
equal deleted inserted replaced
616:56b0b9018319 617:e54c1646eed0
208 default: 208 default:
209 throw new RuntimeException(); 209 throw new RuntimeException();
210 } 210 }
211 } 211 }
212 212
213 private synchronized long nextId(LuanState luan) throws LuanException, IOException { 213 public synchronized long nextId(LuanState luan) throws LuanException, IOException {
214 if( ++id > idLim ) { 214 if( ++id > idLim ) {
215 idLim += idBatch; 215 idLim += idBatch;
216 LuanTable doc = new LuanTable(); 216 LuanTable doc = new LuanTable();
217 doc.rawPut( "type", "next_id" ); 217 doc.rawPut( "type", "next_id" );
218 doc.rawPut( FLD_NEXT_ID, idLim ); 218 doc.rawPut( FLD_NEXT_ID, idLim );