You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2020/07/02 11:33:30 UTC

[jena] branch master updated: JENA-1932 Elasticsearch text index incorrectly maps properties to fields

This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/master by this push:
     new 14ef282  JENA-1932 Elasticsearch text index incorrectly maps properties to fields
     new fe72f71  Merge pull request #770 from strangepleasures/JENA-1932
14ef282 is described below

commit 14ef282e054b401b63756f6f8eab59e2eef98380
Author: strangepleasures <pa...@thehyve.nl>
AuthorDate: Tue Jun 30 13:18:31 2020 +0200

    JENA-1932 Elasticsearch text index incorrectly maps properties to fields
---
 .../src/main/java/org/apache/jena/query/text/es/TextIndexES.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java
index 0955cfd..751366f 100644
--- a/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java
+++ b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java
@@ -393,7 +393,12 @@ public class TextIndexES implements TextIndex {
             limit = MAX_RESULTS;
         
         if(property != null) {
-            qs = parse(property.getLocalName(), qs, lang);
+            String field = docDef.getField(property);
+            if (field == null) {
+                LOGGER.warn("No field mapping for property " + property);
+                return Collections.emptyList();
+            }
+            qs = parse(field, qs, lang);
         } else {
             qs = parse(null, qs, lang);
         }