jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r394959 - in /jackrabbit/trunk/jackrabbit/src/main: config/ java/org/apache/jackrabbit/core/query/lucene/
Date Tue, 18 Apr 2006 14:47:50 GMT
Author: mreutegg
Date: Tue Apr 18 07:47:42 2006
New Revision: 394959

URL: http://svn.apache.org/viewcvs?rev=394959&view=rev
Log:
Provide a new configuration parameter for SearchIndex: maxFieldLength. Corresponds to the
lucene property maxFieldLength.

Modified:
    jackrabbit/trunk/jackrabbit/src/main/config/repository.xml
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit/src/main/config/repository.xml
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/config/repository.xml?rev=394959&r1=394958&r2=394959&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/config/repository.xml (original)
+++ jackrabbit/trunk/jackrabbit/src/main/config/repository.xml Tue Apr 18 07:47:42 2006
@@ -206,6 +206,7 @@
               moved to persistent index even though minMergeDocs is not reached.
             - maxMergeDocs: maximum number of nodes in segments that will be merged
             - mergeFactor: determines how often segment indices are merged
+            - maxFieldLength: the number of words that are fulltext indexed at most per property.
             - bufferSize: maximum number of documents that are held in a pending
               queue until added to the index
             - cacheSize: size of the document number cache. This cache maps
@@ -235,6 +236,7 @@
             <param name="volatileIdleTime" value="3"/>
             <param name="maxMergeDocs" value="100000"/>
             <param name="mergeFactor" value="10"/>
+            <param name="maxFieldLength" value="10000"/>
             <param name="bufferSize" value="10"/>
             <param name="cacheSize" value="1000"/>
             <param name="forceConsistencyCheck" value="false"/>

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java?rev=394959&r1=394958&r2=394959&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
Tue Apr 18 07:47:42 2006
@@ -75,6 +75,9 @@
     /** mergeFactor config parameter */
     private int mergeFactor = SearchIndex.DEFAULT_MERGE_FACTOR;
 
+    /** maxFieldLength config parameter */
+    private int maxFieldLength = SearchIndex.DEFAULT_MAX_FIELD_LENGTH;
+
     /**
      * The document number cache if this index may use one.
      */
@@ -206,6 +209,7 @@
             indexWriter.minMergeDocs = minMergeDocs;
             indexWriter.maxMergeDocs = maxMergeDocs;
             indexWriter.mergeFactor = mergeFactor;
+            indexWriter.maxFieldLength = maxFieldLength;
             indexWriter.setUseCompoundFile(useCompoundFile);
             indexWriter.infoStream = STREAM_LOGGER;
         }
@@ -338,6 +342,16 @@
         this.mergeFactor = mergeFactor;
         if (indexWriter != null) {
             indexWriter.mergeFactor = mergeFactor;
+        }
+    }
+
+    /**
+     * The lucene index writer property: maxFieldLength
+     */
+    void setMaxFieldLength(int maxFieldLength) {
+        this.maxFieldLength = maxFieldLength;
+        if (indexWriter != null) {
+            indexWriter.maxFieldLength = maxFieldLength;
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java?rev=394959&r1=394958&r2=394959&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
Tue Apr 18 07:47:42 2006
@@ -247,6 +247,7 @@
                 index.setMaxMergeDocs(handler.getMaxMergeDocs());
                 index.setMergeFactor(handler.getMergeFactor());
                 index.setMinMergeDocs(handler.getMinMergeDocs());
+                index.setMaxFieldLength(handler.getMaxFieldLength());
                 index.setUseCompoundFile(handler.getUseCompoundFile());
                 indexes.add(index);
                 merger.indexAdded(index.getName(), index.getNumDocuments());
@@ -479,6 +480,7 @@
         index.setMaxMergeDocs(handler.getMaxMergeDocs());
         index.setMergeFactor(handler.getMergeFactor());
         index.setMinMergeDocs(handler.getMinMergeDocs());
+        index.setMaxFieldLength(handler.getMaxFieldLength());
         index.setUseCompoundFile(handler.getUseCompoundFile());
 
         // add to list of open indexes and return it
@@ -717,6 +719,7 @@
     private void resetVolatileIndex() throws IOException {
         volatileIndex = new VolatileIndex(handler.getTextAnalyzer());
         volatileIndex.setUseCompoundFile(handler.getUseCompoundFile());
+        volatileIndex.setMaxFieldLength(handler.getMaxFieldLength());
         volatileIndex.setBufferSize(handler.getBufferSize());
     }
 

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=394959&r1=394958&r2=394959&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Tue Apr 18 07:47:42 2006
@@ -85,6 +85,11 @@
     public static final int DEFAULT_MERGE_FACTOR = 10;
 
     /**
+     * the default value for property {@link #maxFieldLength}.
+     */
+    public static final int DEFAULT_MAX_FIELD_LENGTH = 10000;
+
+    /**
      * Default text filters.
      */
     public static final String DEFAULT_TEXT_FILTERS = TextPlainTextFilter.class.getName();
@@ -132,6 +137,11 @@
     private int mergeFactor = DEFAULT_MERGE_FACTOR;
 
     /**
+     * maxFieldLength config parameter
+     */
+    private int maxFieldLength = DEFAULT_MAX_FIELD_LENGTH;
+
+    /**
      * Number of documents that are buffered before they are added to the index.
      */
     private int bufferSize = 10;
@@ -716,6 +726,14 @@
 
     public int getCacheSize() {
         return cacheSize;
+    }
+
+    public void setMaxFieldLength(int length) {
+        maxFieldLength = length;
+    }
+
+    public int getMaxFieldLength() {
+        return maxFieldLength;
     }
 
     /**



Mime
View raw message