jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r497458 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Date Thu, 18 Jan 2007 15:33:15 GMT
Author: mreutegg
Date: Thu Jan 18 07:33:15 2007
New Revision: 497458

URL: http://svn.apache.org/viewvc?view=rev&rev=497458
Log:
JCR-390: Move text extraction into a background thread
- allow subclasses to create custom text extractor

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?view=diff&rev=497458&r1=497457&r2=497458
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Thu Jan 18 07:33:15 2007
@@ -253,12 +253,7 @@
             excludedIDs.add(context.getExcludedNodeId());
         }
 
-        extractor = new JackrabbitTextExtractor(textFilterClasses);
-        if (extractorPoolSize > 0) {
-            // wrap with pool
-            extractor = new PooledTextExtractor(extractor, extractorPoolSize,
-                    extractorBackLog, extractorTimeout);
-        }
+        extractor = createTextExtractor();
 
         File indexDir = new File(path);
 
@@ -528,6 +523,21 @@
      */
     protected MultiIndex getIndex() {
         return index;
+    }
+
+    /**
+     * Factory method to create the <code>TextExtractor</code> instance.
+     *
+     * @return the <code>TextExtractor</code> instance this index should use.
+     */
+    protected TextExtractor createTextExtractor() {
+        TextExtractor txtExtr = new JackrabbitTextExtractor(textFilterClasses);
+        if (extractorPoolSize > 0) {
+            // wrap with pool
+            txtExtr = new PooledTextExtractor(txtExtr, extractorPoolSize,
+                    extractorBackLog, extractorTimeout);
+        }
+        return txtExtr;
     }
 
     //----------------------------< internal >----------------------------------



Mime
View raw message