comparison src/luan/modules/lucene/SupplementingConfig.java @ 1562:b89212fd04b5

remove table.luan
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 08 Nov 2020 16:50:59 -0700
parents e6d808f40bbc
children 8fbcc4747091
comparison
equal deleted inserted replaced
1561:e1a13e707bf3 1562:b89212fd04b5
36 36
37 public MoreFieldInfo getMoreFieldInfo(Map<String,Object> storedFields) { 37 public MoreFieldInfo getMoreFieldInfo(Map<String,Object> storedFields) {
38 if( supplementer == null ) 38 if( supplementer == null )
39 return super.getMoreFieldInfo(storedFields); 39 return super.getMoreFieldInfo(storedFields);
40 try { 40 try {
41 LuanTable tbl = toTable(supplementer.luan(),storedFields); 41 LuanTable tbl = toTable(storedFields);
42 tbl = (LuanTable)supplementer.call(tbl); 42 tbl = (LuanTable)supplementer.call(tbl);
43 if( tbl == null ) { 43 if( tbl == null ) {
44 return super.getMoreFieldInfo(storedFields); 44 return super.getMoreFieldInfo(storedFields);
45 } else { 45 } else {
46 return new MoreFieldInfo(toLucene(tbl),Collections.emptyMap()); 46 return new MoreFieldInfo(toLucene(tbl),Collections.emptyMap());
48 } catch(LuanException e) { 48 } catch(LuanException e) {
49 throw new LuanRuntimeException(e); 49 throw new LuanRuntimeException(e);
50 } 50 }
51 } 51 }
52 52
53 static LuanTable toTable(Luan luan,Map map) throws LuanException { 53 static LuanTable toTable(Map map) throws LuanException {
54 LuanTable table = new LuanTable(luan); 54 LuanTable table = new LuanTable();
55 for( Object obj : map.entrySet() ) { 55 for( Object obj : map.entrySet() ) {
56 Map.Entry entry = (Map.Entry)obj; 56 Map.Entry entry = (Map.Entry)obj;
57 Object value = entry.getValue(); 57 Object value = entry.getValue();
58 if( value instanceof List ) 58 if( value instanceof List )
59 value = new LuanTable(luan,(List)value); 59 value = new LuanTable((List)value);
60 table.rawPut( entry.getKey(), value ); 60 table.rawPut( entry.getKey(), value );
61 } 61 }
62 return table; 62 return table;
63 } 63 }
64 64