diff src/luan/modules/lucene/SupplementingConfig.java @ 1563:8fbcc4747091

remove LuanFunction.luan
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 09 Nov 2020 01:37:57 -0700
parents b89212fd04b5
children c922446f53aa
line wrap: on
line diff
--- a/src/luan/modules/lucene/SupplementingConfig.java	Sun Nov 08 16:50:59 2020 -0700
+++ b/src/luan/modules/lucene/SupplementingConfig.java	Mon Nov 09 01:37:57 2020 -0700
@@ -19,27 +19,29 @@
 
 
 final class SupplementingConfig extends MultiFieldParserConfig {
+	private final Luan luan;
 	private final LuanFunction supplementer;
 
-	SupplementingConfig(Version luceneVersion,MultiFieldParser mfp,LuanFunction supplementer) {
+	SupplementingConfig(Version luceneVersion,MultiFieldParser mfp,Luan luan,LuanFunction supplementer) {
 		super(luceneVersion,mfp);
 		LuanCloner cloner = new LuanCloner(LuanCloner.Type.COMPLETE);
+		this.luan = (Luan)cloner.get(luan);
 		this.supplementer = (LuanFunction)cloner.get(supplementer);
 	}
 
-	public IndexWriterConfig newLuceneConfig() {
+	@Override public IndexWriterConfig newLuceneConfig() {
 		IndexWriterConfig luceneConfig = super.newLuceneConfig();
 		SnapshotDeletionPolicy snapshotDeletionPolicy = new SnapshotDeletionPolicy(luceneConfig.getIndexDeletionPolicy());
 		luceneConfig.setIndexDeletionPolicy(snapshotDeletionPolicy);
 		return luceneConfig;
 	}
 
-	public MoreFieldInfo getMoreFieldInfo(Map<String,Object> storedFields) {
+	@Override public MoreFieldInfo getMoreFieldInfo(Map<String,Object> storedFields) {
 		if( supplementer == null )
 			return super.getMoreFieldInfo(storedFields);
 		try {
 			LuanTable tbl = toTable(storedFields);
-			tbl = (LuanTable)supplementer.call(tbl);
+			tbl = (LuanTable)supplementer.call(luan,tbl);
 			if( tbl == null ) {
 				return super.getMoreFieldInfo(storedFields);
 			} else {
@@ -64,7 +66,7 @@
 
 	static Map<String,Object> toLucene(LuanTable table) throws LuanException {
 		Map<String,Object> map = new LinkedHashMap<String,Object>();
-		for( Map.Entry<Object,Object> entry : table.iterable() ) {
+		for( Map.Entry<Object,Object> entry : table.rawIterable() ) {
 			String name = (String)entry.getKey();
 			Object value  = entry.getValue();
 			if( value instanceof LuanTable ) {