You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2015/10/08 15:09:26 UTC

[jira] [Commented] (OAK-3495) Query engine: disable or restrict built-in full-text engine (backport to 1.0)

    [ https://issues.apache.org/jira/browse/OAK-3495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948626#comment-14948626 ] 

Thomas Mueller commented on OAK-3495:
-------------------------------------

I found out that _disabling_ the built-in full-text engine would require changing quite many tests (that means, also backport changes to the tests). That would be possible, but would require more changes.

The following patch just _restricts_ the built-in full-text engine to String only. That means binaries are not read. This should avoid out-of-memory. It is the same code as used in Oak 1.2.x and newer.

{noformat}
oak-core
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java	(revision 1707457)
+++ src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java	(working copy)
@@ -215,13 +215,23 @@
     
     private static void appendString(StringBuilder buff, PropertyValue p) {
         if (p.isArray()) {
-            for (String v : p.getValue(STRINGS)) {
-                buff.append(v).append(' ');
+            if (p.getType() == Type.BINARIES) {
+                // OAK-3495: don't try to load binaries as this would 
+                // run out of memory
+            } else {
+                for (String v : p.getValue(STRINGS)) {
+                    buff.append(v).append(' ');
+                }
             }
         } else {
-            buff.append(p.getValue(STRING)).append(' ');
+            if (p.getType() == Type.BINARY) {
+                // OAK-3495: don't try to load binaries as this would 
+                // run out of memory
+            } else {
+                buff.append(p.getValue(STRING)).append(' ');
+            }
         }
-    }
+    }    
 
     public void bindSelector(SourceImpl source) {
         selector = source.getExistingSelector(selectorName);
{noformat}

> Query engine: disable or restrict built-in full-text engine (backport to 1.0)
> -----------------------------------------------------------------------------
>
>                 Key: OAK-3495
>                 URL: https://issues.apache.org/jira/browse/OAK-3495
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.0.23
>
>
> With Oak 1.0.x, the built-in full-text engine is used if no other full-text index is available. This is different than in newer versions of Oak, where the built-in engine is disabled in that case by default.
> I think it makes sense to backport this to Oak 1.0.x, so that all versions behave the same way. 
> This is to prevent out-of-memory problems if no full-text index is configured.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)