changeset 1530:447b7ef9197f

minor fix
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 28 Jul 2020 22:12:36 -0600
parents e6d808f40bbc
children fa39e3c356ae
files src/luan/modules/lucene/LuceneIndex.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/modules/lucene/LuceneIndex.java	Mon Jul 27 12:54:31 2020 -0600
+++ b/src/luan/modules/lucene/LuceneIndex.java	Tue Jul 28 22:12:36 2020 -0600
@@ -881,10 +881,13 @@
 				LuanTable v = (LuanTable)value;
 				if( !v.isList() )
 					logger.error("not list");
-				if( v.isEmpty() ) {
+				List list = v.asList();
+				if( list.isEmpty() ) {
 					iter.remove();
+				} else if( list.size() == 1 ) {
+					entry.setValue(list.get(0));
 				} else {
-					entry.setValue(v.asList());
+					entry.setValue(list);
 				}
 			}
 		}