Mercurial Hosting > luan
diff lucene/src/luan/modules/lucene/LuceneIndex.java @ 575:7c3ad6db8ac3
make LuanState.JAVA private
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 13 Jul 2015 18:34:31 -0600 |
parents | 6cc2f047019b |
children | 60c549d43988 |
line wrap: on
line diff
--- a/lucene/src/luan/modules/lucene/LuceneIndex.java Mon Jul 13 12:31:53 2015 -0600 +++ b/lucene/src/luan/modules/lucene/LuceneIndex.java Mon Jul 13 18:34:31 2015 -0600 @@ -134,16 +134,16 @@ } public void save(LuanState luan,LuanTable doc) throws LuanException, IOException { - if( doc.get(luan.JAVA,"type")==null ) + if( doc.get(luan,"type")==null ) throw luan.exception("missing 'type' field"); - Long id = (Long)doc.get(luan.JAVA,"id"); + Long id = (Long)doc.get(luan,"id"); boolean commit = !writeLock.isHeldByCurrentThread(); writeLock.lock(); try { if( id == null ) { id = nextId(luan); - doc.put(luan.JAVA,"id",id); + doc.put(luan,"id",id); writer.addDocument(toLucene(luan,doc)); } else { writer.updateDocument( term("id",id), toLucene(luan,doc) ); @@ -403,7 +403,7 @@ private Document toLucene(LuanState luan,LuanTable table) throws LuanException { Set<String> indexed = mfp.fields.keySet(); Document doc = new Document(); - for( Map.Entry<Object,Object> entry : table.iterable(luan.JAVA) ) { + for( Map.Entry<Object,Object> entry : table.iterable(luan) ) { Object key = entry.getKey(); if( !(key instanceof String) ) throw luan.exception("key must be string");