diff lucene/src/luan/modules/lucene/LuceneIndex.java @ 572:f1601a4ce1aa

fix stack when calling meta-methods
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 12 Jul 2015 21:34:23 -0600
parents 0be287ab0309
children 6cc2f047019b
line wrap: on
line diff
--- a/lucene/src/luan/modules/lucene/LuceneIndex.java	Wed Jul 08 23:10:52 2015 -0600
+++ b/lucene/src/luan/modules/lucene/LuceneIndex.java	Sun Jul 12 21:34:23 2015 -0600
@@ -134,16 +134,16 @@
 	}
 
 	public void save(LuanState luan,LuanTable doc) throws LuanException, IOException {
-		if( doc.get(luan,"type")==null )
+		if( doc.get(luan.JAVA,"type")==null )
 			throw luan.exception("missing 'type' field");
-		Long id = (Long)doc.get(luan,"id");
+		Long id = (Long)doc.get(luan.JAVA,"id");
 
 		boolean commit = !writeLock.isHeldByCurrentThread();
 		writeLock.lock();
 		try {
 			if( id == null ) {
 				id = nextId(luan);
-				doc.put(luan,"id",id);
+				doc.put(luan.JAVA,"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) ) {
+		for( Map.Entry<Object,Object> entry : table.iterable(luan.JAVA) ) {
 			Object key = entry.getKey();
 			if( !(key instanceof String) )
 				throw luan.exception("key must be string");