From 490ad93d3c15aaa7ef6fe3ba01beadbf4c15d98e Mon Sep 17 00:00:00 2001 From: Tglman Date: Fri, 27 Sep 2024 18:01:18 +0100 Subject: [PATCH] fix: corrected regression after refactor --- .../lucene/functions/OLuceneSearchOnIndexFunction.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnIndexFunction.java b/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnIndexFunction.java index 247eccd2062..25933d29668 100644 --- a/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnIndexFunction.java +++ b/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnIndexFunction.java @@ -9,7 +9,6 @@ import com.orientechnologies.orient.core.db.record.OIdentifiable; import com.orientechnologies.orient.core.id.ORID; import com.orientechnologies.orient.core.index.OIndex; -import com.orientechnologies.orient.core.record.OElement; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.sql.executor.OResult; import com.orientechnologies.orient.core.sql.executor.OResultInternal; @@ -58,10 +57,6 @@ public Object execute( } OResult result = (OResult) iThis; - if (!result.getElement().isPresent()) return false; - OElement element = result.getElement().get(); - if (!element.getSchemaType().isPresent()) return false; - String indexName = (String) params[0]; OLuceneFullTextIndex index = searchForIndex(ctx, indexName); @@ -74,7 +69,7 @@ public Object execute( List key = index.getDefinition().getFields().stream() - .map(s -> element.getProperty(s)) + .map(s -> result.getProperty(s)) .collect(Collectors.toList()); for (IndexableField field : index.buildDocument(key).getFields()) {