lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r1073192 [24/32] - in /lucene/dev/branches/realtime_search: ./ dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/idea/lucene/contrib/ant/ dev-tools/idea/lucene/contrib/demo/ dev-tools/idea/lucene/contrib/highlighter/ dev-tools/idea/lucene/...
Date Tue, 22 Feb 2011 01:01:11 GMT
Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java Tue Feb 22 01:00:39 2011
@@ -74,7 +74,6 @@ public class SolrZkClient {
    * @param zkClientTimeout
    * @param strat
    * @param onReconnect
-   * @param clientConnectTimeout
    * @throws InterruptedException
    * @throws TimeoutException
    * @throws IOException
@@ -164,7 +163,7 @@ public class SolrZkClient {
   
   /**
    * @param path
-   * @return
+   * @return true if path exists
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -178,7 +177,7 @@ public class SolrZkClient {
    * @param data
    * @param acl
    * @param createMode
-   * @return
+   * @return path of created node
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -190,7 +189,7 @@ public class SolrZkClient {
   /**
    * @param path
    * @param watcher
-   * @return
+   * @return children of the node at the path
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -203,7 +202,7 @@ public class SolrZkClient {
    * @param path
    * @param watcher
    * @param stat
-   * @return
+   * @return node's data
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -216,7 +215,7 @@ public class SolrZkClient {
    * @param path
    * @param data
    * @param version
-   * @return
+   * @return node's state
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -229,8 +228,8 @@ public class SolrZkClient {
    * 
    * @param path
    * @param data
-   * @param watcher
-   * @return
+   * @param createMode
+   * @return path of created node
    * @throws KeeperException
    * @throws InterruptedException
    */

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java Tue Feb 22 01:00:39 2011
@@ -46,6 +46,7 @@ public class ZkNodeProps extends HashMap
     return sb.toString().getBytes("UTF-8");
   }
   
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
     Set<Entry<String,String>> entries = entrySet();

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/FacetParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/FacetParams.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/FacetParams.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/FacetParams.java Tue Feb 22 01:00:39 2011
@@ -228,7 +228,6 @@ public interface FacetParams {
    * String indicating what "other" ranges should be computed for a
    * numerical range facet (multi-value).
    * Can be overriden on a per field basis.
-   * @see FacetNumberOther
    */
   public static final String FACET_RANGE_OTHER = FACET_RANGE + ".other";
   /**
@@ -270,6 +269,7 @@ public interface FacetParams {
    */
   public enum FacetRangeOther {
     BEFORE, AFTER, BETWEEN, ALL, NONE;
+    @Override
     public String toString() { return super.toString().toLowerCase(); }
     public static FacetRangeOther get(String label) {
       try {
@@ -288,6 +288,7 @@ public interface FacetParams {
   @Deprecated
   public enum FacetDateOther {
     BEFORE, AFTER, BETWEEN, ALL, NONE;
+    @Override
     public String toString() { return super.toString().toLowerCase(); }
     public static FacetDateOther get(String label) {
       try {
@@ -321,6 +322,7 @@ public interface FacetParams {
    */
   public enum FacetRangeInclude {
     ALL, LOWER, UPPER, EDGE, OUTER;
+    @Override
     public String toString() { return super.toString().toLowerCase(Locale.ENGLISH); }
     public static FacetRangeInclude get(String label) {
       try {

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java Tue Feb 22 01:00:39 2011
@@ -1,5 +1,22 @@
 package org.apache.solr.common.params;
 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 
 /**
  * Parameters used with the QueryElevationComponent

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java Tue Feb 22 01:00:39 2011
@@ -133,6 +133,7 @@ public class ConcurrentLRUCache<K,V> {
     if (currentSize > upperWaterMark && !isCleaning) {
       if (newThreadForCleanup) {
         new Thread() {
+          @Override
           public void run() {
             markAndSweep();
           }
@@ -362,6 +363,7 @@ public class ConcurrentLRUCache<K,V> {
       return Collections.unmodifiableCollection(Arrays.asList(heap));
     }
 
+    @Override
     protected boolean lessThan(CacheEntry a, CacheEntry b) {
       // reverse the parameter order so that the queue keeps the oldest items
       return b.lastAccessedCopy < a.lastAccessedCopy;
@@ -491,14 +493,17 @@ public class ConcurrentLRUCache<K,V> {
       return this.lastAccessedCopy < that.lastAccessedCopy ? 1 : -1;
     }
 
+    @Override
     public int hashCode() {
       return value.hashCode();
     }
 
+    @Override
     public boolean equals(Object obj) {
       return value.equals(obj);
     }
 
+    @Override
     public String toString() {
       return "key: " + key + " value: " + value + " lastAccessed:" + lastAccessed;
     }
@@ -579,6 +584,7 @@ public class ConcurrentLRUCache<K,V> {
       cache = new WeakReference<ConcurrentLRUCache>(c);
     }
 
+    @Override
     public void run() {
       while (true) {
         synchronized (this) {
@@ -608,6 +614,7 @@ public class ConcurrentLRUCache<K,V> {
     }
   }
 
+  @Override
   protected void finalize() throws Throwable {
     try {
       if(!isDestroyed){

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/FastOutputStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/FastOutputStream.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/FastOutputStream.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/FastOutputStream.java Tue Feb 22 01:00:39 2011
@@ -50,6 +50,7 @@ public class FastOutputStream extends Ou
     write((byte)b);
   }
 
+  @Override
   public void write(byte b[]) throws IOException {
     write(b,0,b.length);
   }

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java Tue Feb 22 01:00:39 2011
@@ -96,7 +96,8 @@ public class JavaBinCodec {
     FastInputStream dis = FastInputStream.wrap(is);
     version = dis.readByte();
     if (version != VERSION) {
-      throw new RuntimeException("Invalid version or the data in not in 'javabin' format");
+      throw new RuntimeException("Invalid version (expected " + VERSION +
+          ", but " + version + ") or the data in not in 'javabin' format");
     }
     return readVal(dis);
   }

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java Tue Feb 22 01:00:39 2011
@@ -246,6 +246,7 @@ public class NamedList<T> implements Clo
     return result;
   }
 
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
     sb.append('{');
@@ -317,6 +318,7 @@ public class NamedList<T> implements Clo
   /**
    * Makes a <i>shallow copy</i> of the named list.
    */
+  @Override
   public NamedList<T> clone() {
     ArrayList<Object> newList = new ArrayList<Object>(nvPairs.size());
     newList.addAll(nvPairs);
@@ -355,6 +357,7 @@ public class NamedList<T> implements Clo
             return list.getVal( index );
           }
 
+          @Override
           public String toString()
           {
         	  return getKey()+"="+getValue();

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java Tue Feb 22 01:00:39 2011
@@ -37,6 +37,7 @@ public final class RegexFileFilter imple
   public boolean accept(File f) {
     return pattern.matcher(f.getName()).matches();
   }
+  @Override
   public String toString() {
     return "regex:" + pattern.toString();
   }

Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/StrUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/StrUtils.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/StrUtils.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/StrUtils.java Tue Feb 22 01:00:39 2011
@@ -242,7 +242,7 @@ public class StrUtils {
    * {@link NullPointerException} and {@link SolrException} free version of {@link #parseBool(String)}
    * @param s
    * @param def
-   * @return
+   * @return parsed boolean value (or def, if s is null or invalid)
    */
   public static boolean parseBool(String s, boolean def) {
     if( s != null ) {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java Tue Feb 22 01:00:39 2011
@@ -29,6 +29,7 @@ import java.util.Map;
 @Deprecated
 public class ArabicLetterTokenizerFactory extends BaseTokenizerFactory{
 
+  @Override
   public void init(Map<String,String> args) {
     super.init(args);
     assureMatchVersion();

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -29,6 +29,7 @@ import org.apache.lucene.analysis.cn.Chi
  */
 @Deprecated
 public class ChineseFilterFactory extends BaseTokenFilterFactory {
+  @Override
   public void init(Map<String,String> args) {
     super.init(args);
     warnDeprecated("Use StopFilterFactory instead.");

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java Tue Feb 22 01:00:39 2011
@@ -30,6 +30,7 @@ import org.apache.lucene.analysis.cn.Chi
  */
 @Deprecated
 public class ChineseTokenizerFactory extends BaseTokenizerFactory {
+  @Override
   public void init(Map<String,String> args) {
     super.init(args);
     warnDeprecated("Use StandardTokenizerFactory instead.");

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -36,6 +36,7 @@ public class DictionaryCompoundWordToken
   private int minSubwordSize;
   private int maxSubwordSize;
   private boolean onlyLongestMatch;
+  @Override
   public void init(Map<String, String> args) {
     super.init(args);
     assureMatchVersion();

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -61,6 +61,7 @@ public class HyphenationCompoundWordToke
   private int maxSubwordSize;
   private boolean onlyLongestMatch;
   
+  @Override
   public void init(Map<String, String> args) {
     super.init(args);
     assureMatchVersion();

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -26,6 +26,7 @@ import org.apache.lucene.analysis.id.Ind
 public class IndonesianStemFilterFactory extends BaseTokenFilterFactory {
   private boolean stemDerivational = true;
 
+  @Override
   public void init(Map<String, String> args) {
     super.init(args);
     stemDerivational = getBoolean("stemDerivational", true);

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -23,22 +23,27 @@ import org.apache.lucene.analysis.TokenS
 import org.apache.lucene.analysis.miscellaneous.KeepWordFilter;
 import org.apache.lucene.analysis.util.CharArraySet;
 
+import java.util.Map;
 import java.util.Set;
 import java.io.IOException;
 
 /**
  * @version $Id$
- * @since solr 1.3
  */
 public class KeepWordFilterFactory extends BaseTokenFilterFactory implements ResourceLoaderAware {
 
-  private CharArraySet words;
-  private boolean ignoreCase;
+  @Override
+  public void init(Map<String,String> args) {
+    super.init(args);
+    assureMatchVersion();
+  }
 
   public void inform(ResourceLoader loader) {
     String wordFiles = args.get("words");
     ignoreCase = getBoolean("ignoreCase", false);
-    if (wordFiles != null) {   
+    enablePositionIncrements = getBoolean("enablePositionIncrements",false);
+
+    if (wordFiles != null) {
       try {
         words = getWordSet(loader, wordFiles, ignoreCase);
       } catch (IOException e) {
@@ -47,6 +52,10 @@ public class KeepWordFilterFactory exten
     }
   }
 
+  private CharArraySet words;
+  private boolean ignoreCase;
+  private boolean enablePositionIncrements;
+
   /**
    * Set the keep word list.
    * NOTE: if ignoreCase==true, the words are expected to be lowercase
@@ -62,15 +71,19 @@ public class KeepWordFilterFactory exten
     this.ignoreCase = ignoreCase;
   }
 
-  public KeepWordFilter create(TokenStream input) {
-    return new KeepWordFilter(input, words);
+  public boolean isEnablePositionIncrements() {
+    return enablePositionIncrements;
+  }
+
+  public boolean isIgnoreCase() {
+    return ignoreCase;
   }
 
   public CharArraySet getWords() {
     return words;
   }
 
-  public boolean isIgnoreCase() {
-    return ignoreCase;
+  public KeepWordFilter create(TokenStream input) {
+    return new KeepWordFilter(enablePositionIncrements, input, words);
   }
 }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -27,6 +27,7 @@ import java.util.Map;
  */
 public class LengthFilterFactory extends BaseTokenFilterFactory {
   int min,max;
+  boolean enablePositionIncrements;
   public static final String MIN_KEY = "min";
   public static final String MAX_KEY = "max";
 
@@ -35,8 +36,10 @@ public class LengthFilterFactory extends
     super.init(args);
     min=Integer.parseInt(args.get(MIN_KEY));
     max=Integer.parseInt(args.get(MAX_KEY));
+    enablePositionIncrements = getBoolean("enablePositionIncrements",false);
   }
+  
   public LengthFilter create(TokenStream input) {
-    return new LengthFilter(input,min,max);
+    return new LengthFilter(enablePositionIncrements, input,min,max);
   }
 }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -27,6 +27,7 @@ import java.util.Map;
 public class NumericPayloadTokenFilterFactory extends BaseTokenFilterFactory {
   private float payload;
   private String typeMatch;
+  @Override
   public void init(Map<String, String> args) {
     super.init(args);
     payload = Float.parseFloat(args.get("payload"));

Added: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PathHierarchyTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PathHierarchyTokenizerFactory.java?rev=1073192&view=auto
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PathHierarchyTokenizerFactory.java (added)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PathHierarchyTokenizerFactory.java Tue Feb 22 01:00:39 2011
@@ -0,0 +1,73 @@
+package org.apache.solr.analysis;
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.Reader;
+import java.util.Map;
+
+import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.path.PathHierarchyTokenizer;
+
+
+/**
+ * @version $Id$
+ */
+public class PathHierarchyTokenizerFactory extends BaseTokenizerFactory {
+  
+  private char delimiter;
+  private char replacement;
+  
+  /**
+   * Require a configured pattern
+   */
+  @Override
+  public void init(Map<String,String> args){
+    super.init( args );
+    
+    String v = args.get( "delimiter" );
+    if( v != null ){
+      if( v.length() != 1 ){
+        throw new IllegalArgumentException( "delimiter should be a char. \"" + v + "\" is invalid" );
+      }
+      else{
+        delimiter = v.charAt(0);
+      }
+    }
+    else{
+      delimiter = PathHierarchyTokenizer.DEFAULT_DELIMITER;
+    }
+    
+    v = args.get( "replace" );
+    if( v != null ){
+      if( v.length() != 1 ){
+        throw new IllegalArgumentException( "replace should be a char. \"" + v + "\" is invalid" );
+      }
+      else{
+        replacement = v.charAt(0);
+      }
+    }
+    else{
+      replacement = delimiter;
+    }
+  }
+
+  public Tokenizer create(Reader input) {
+    return new PathHierarchyTokenizer(input, delimiter, replacement);
+  }
+}
+
+

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -36,6 +36,7 @@ public class PatternReplaceCharFilterFac
   private int maxBlockChars;
   private String blockDelimiters;
 
+  @Override
   public void init(Map<String, String> args) {
     super.init( args );
     try {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PositionFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PositionFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PositionFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/PositionFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -33,6 +33,7 @@ import java.util.Map;
 public class PositionFilterFactory extends BaseTokenFilterFactory {
   private int positionIncrement;
 
+  @Override
   public void init(Map<String, String> args) {
     super.init(args);
     positionIncrement = getInt("positionIncrement", 0);

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ShingleFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ShingleFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ShingleFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/ShingleFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -34,6 +34,7 @@ public class ShingleFilterFactory extend
   private boolean outputUnigramsIfNoShingles;
   private String tokenSeparator;
 
+  @Override
   public void init(Map<String, String> args) {
     super.init(args);
     maxShingleSize = getInt("maxShingleSize", 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/SolrAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/SolrAnalyzer.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/SolrAnalyzer.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/SolrAnalyzer.java Tue Feb 22 01:00:39 2011
@@ -32,6 +32,7 @@ public abstract class SolrAnalyzer exten
     posIncGap=gap;
   }
 
+  @Override
   public int getPositionIncrementGap(String fieldName) {
     return posIncGap;
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/StopFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/StopFilterFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/StopFilterFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/StopFilterFactory.java Tue Feb 22 01:00:39 2011
@@ -29,6 +29,15 @@ import java.util.Set;
 import java.io.IOException;
 
 /**
+ * Factory for {@link StopFilter}.
+ * <pre class="prettyprint" >
+ * &lt;fieldType name="text_stop" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true"&gt;
+ *   &lt;analyzer&gt;
+ *     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
+ *     &lt;filter class="solr.StopFilterFactory" ignoreCase="true"
+ *             words="stopwords.txt" enablePositionIncrements="true"/&gt;
+ *   &lt;/analyzer&gt;
+ * &lt;/fieldType&gt;</pre>
  * @version $Id$
  */
 public class StopFilterFactory extends BaseTokenFilterFactory implements ResourceLoaderAware {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/TokenizerChain.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/TokenizerChain.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/TokenizerChain.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/analysis/TokenizerChain.java Tue Feb 22 01:00:39 2011
@@ -73,6 +73,7 @@ public final class TokenizerChain extend
     return new TokenStreamInfo(tk,ts);
   }
 
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder("TokenizerChain(");
     for (CharFilterFactory filter: charFilters) {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/SolrZkServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/SolrZkServer.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/SolrZkServer.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/SolrZkServer.java Tue Feb 22 01:00:39 2011
@@ -319,6 +319,7 @@ class SolrZkServerProps extends QuorumPe
    * @throws java.io.IOException
    * @throws ConfigException
    */
+  @Override
   public void parseProperties(Properties zkProp)
       throws IOException, ConfigException {
     for (Entry<Object, Object> entry : zkProp.entrySet()) {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkController.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkController.java Tue Feb 22 01:00:39 2011
@@ -186,7 +186,7 @@ public final class ZkController {
   /**
    * @param collection
    * @param fileName
-   * @return
+   * @return true if config file exists
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -206,7 +206,7 @@ public final class ZkController {
   /**
    * @param zkConfigName
    * @param fileName
-   * @return
+   * @return config file data (in bytes)
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -250,7 +250,7 @@ public final class ZkController {
   }
 
   /**
-   * @return
+   * @return zookeeper server address
    */
   public String getZkServerAddress() {
     return zkServerAddress;
@@ -392,7 +392,7 @@ public final class ZkController {
 
   /**
    * @param path
-   * @return
+   * @return true if the path exists
    * @throws KeeperException
    * @throws InterruptedException
    */
@@ -403,7 +403,7 @@ public final class ZkController {
 
   /**
    * @param collection
-   * @return
+   * @return config value
    * @throws KeeperException
    * @throws InterruptedException
    * @throws IOException 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java Tue Feb 22 01:00:39 2011
@@ -68,6 +68,7 @@ public class ZkSolrResourceLoader extend
    * 
    * @return the stream for the named resource
    */
+  @Override
   public InputStream openResource(String resource) {
     InputStream is = null;
     String file = collectionZkPath + "/" + resource;
@@ -93,12 +94,14 @@ public class ZkSolrResourceLoader extend
     return is;
   }
 
+  @Override
   public String getConfigDir() {
     throw new ZooKeeperException(
         ErrorCode.SERVER_ERROR,
         "ZkSolrResourceLoader does not support getConfigDir() - likely, what you are trying to do is not supported in ZooKeeper mode");
   }
   
+  @Override
   public String[] listConfigDir() {
     List<String> list;
     try {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/AbstractSolrEventListener.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/AbstractSolrEventListener.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/AbstractSolrEventListener.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/AbstractSolrEventListener.java Tue Feb 22 01:00:39 2011
@@ -42,6 +42,7 @@ class AbstractSolrEventListener implemen
     throw new UnsupportedOperationException();
   }
 
+  @Override
   public String toString() {
     return getClass().getName() + args;
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/CoreContainer.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/CoreContainer.java Tue Feb 22 01:00:39 2011
@@ -133,6 +133,11 @@ public class CoreContainer 
     if (zkRun == null && zookeeperHost == null)
         return;  // not in zk mode
 
+    // zookeeper in quorum mode currently causes a failure when trying to
+    // register log4j mbeans.  See SOLR-2369
+    // TODO: remove after updating to an slf4j based zookeeper
+    System.setProperty("zookeeper.jmx.log4j.disable", "true");
+
     zkServer = new SolrZkServer(zkRun, zookeeperHost, solrHome, hostPort);
     zkServer.parseConfig();
     zkServer.start();
@@ -232,7 +237,7 @@ public class CoreContainer 
         cores.load(solrHome, fconf);
       } else {
         log.info("no solr.xml file found - using default");
-        cores.load(solrHome, new ByteArrayInputStream(DEF_SOLR_XML.getBytes()));
+        cores.load(solrHome, new ByteArrayInputStream(DEF_SOLR_XML.getBytes("UTF-8")));
         cores.configFile = fconf;
       }
       

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RAMDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RAMDirectoryFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RAMDirectoryFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RAMDirectoryFactory.java Tue Feb 22 01:00:39 2011
@@ -45,6 +45,7 @@ public class RAMDirectoryFactory extends
     }
   }
   
+  @Override
   public boolean exists(String path) {
     synchronized (RAMDirectoryFactory.class) {
       RefCntRamDirectory directory = directories.get(path);

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java Tue Feb 22 01:00:39 2011
@@ -1,3 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.solr.core;
 
 import java.io.IOException;
@@ -34,6 +51,7 @@ public class RefCntRamDirectory extends 
     }
   }
 
+  @Override
   public final synchronized void close() {
     decRef();
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RunExecutableListener.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RunExecutableListener.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RunExecutableListener.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/RunExecutableListener.java Tue Feb 22 01:00:39 2011
@@ -37,6 +37,7 @@ class RunExecutableListener extends Abst
   protected String[] envp;
   protected boolean wait=true;
 
+  @Override
   public void init(NamedList args) {
     super.init(args);
 
@@ -102,6 +103,7 @@ class RunExecutableListener extends Abst
   }
 
 
+  @Override
   public void postCommit() {
     // anything generic need to be passed to the external program?
     // the directory of the index?  the command that caused it to be
@@ -109,6 +111,7 @@ class RunExecutableListener extends Abst
     exec("postCommit");
   }
 
+  @Override
   public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher) {
     exec("newSearcher");
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrConfig.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrConfig.java Tue Feb 22 01:00:39 2011
@@ -141,7 +141,7 @@ public class SolrConfig extends Config {
     filtOptThreshold = getFloat("query/boolTofilterOptimizer/@threshold",.05f);
     
     useFilterForSortedQuery = getBool("query/useFilterForSortedQuery", false);
-    queryResultWindowSize = getInt("query/queryResultWindowSize", 1);
+    queryResultWindowSize = Math.max(1, getInt("query/queryResultWindowSize", 1));
     queryResultMaxDocsCached = getInt("query/queryResultMaxDocsCached", Integer.MAX_VALUE);
     enableLazyFieldLoading = getBool("query/enableLazyFieldLoading", false);
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java Tue Feb 22 01:00:39 2011
@@ -696,6 +696,7 @@ public final class SolrCore implements S
       return refCount.get() <= 0;
   }
   
+  @Override
   protected void finalize() throws Throwable {
     try {
       if (getOpenCount() != 0) {
@@ -1192,6 +1193,7 @@ public final class SolrCore implements S
 
   private RefCounted<SolrIndexSearcher> newHolder(SolrIndexSearcher newSearcher) {
     RefCounted<SolrIndexSearcher> holder = new RefCounted<SolrIndexSearcher>(newSearcher) {
+      @Override
       public void close() {
         try {
           synchronized(searcherLock) {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardDirectoryFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardDirectoryFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardDirectoryFactory.java Tue Feb 22 01:00:39 2011
@@ -28,6 +28,7 @@ import org.apache.lucene.store.FSDirecto
  */
 public class StandardDirectoryFactory extends DirectoryFactory {
 
+  @Override
   public Directory open(String path) throws IOException {
     return FSDirectory.open(new File(path));
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardIndexReaderFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardIndexReaderFactory.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardIndexReaderFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/StandardIndexReaderFactory.java Tue Feb 22 01:00:39 2011
@@ -32,6 +32,7 @@ public class StandardIndexReaderFactory 
   /* (non-Javadoc)
    * @see org.apache.solr.core.IndexReaderFactory#newReader(org.apache.lucene.store.Directory, boolean)
    */
+  @Override
   public IndexReader newReader(Directory indexDir, boolean readOnly)
       throws IOException {
     return IndexReader.open(indexDir, null, readOnly, termInfosIndexDivisor);

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java Tue Feb 22 01:00:39 2011
@@ -56,6 +56,7 @@ public abstract class AnalysisRequestHan
 
   public static final Set<BytesRef> EMPTY_BYTES_SET = Collections.emptySet();
 
+  @Override
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
     rsp.add("analysis", doAnalysis(req));
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/BinaryUpdateRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/BinaryUpdateRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/BinaryUpdateRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/BinaryUpdateRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -46,8 +46,10 @@ import java.util.List;
 public class BinaryUpdateRequestHandler extends ContentStreamHandlerBase {
 
 
+  @Override
   protected ContentStreamLoader newLoader(SolrQueryRequest req, final UpdateRequestProcessor processor) {
     return new ContentStreamLoader() {
+      @Override
       public void load(SolrQueryRequest req, SolrQueryResponse rsp, ContentStream stream) throws Exception {
         InputStream is = null;
         try {
@@ -111,18 +113,22 @@ public class BinaryUpdateRequestHandler 
     }
   }
 
+  @Override
   public String getDescription() {
     return "Add/Update multiple documents with javabin format";
   }
 
+  @Override
   public String getSourceId() {
     return "$Id$";
   }
 
+  @Override
   public String getSource() {
     return "$URL$";
   }
 
+  @Override
   public String getVersion() {
     return "$Revision$";
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/CSVRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/CSVRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/CSVRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/CSVRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -42,6 +42,7 @@ import java.io.*;
 
 public class CSVRequestHandler extends ContentStreamHandlerBase {
 
+  @Override
   protected ContentStreamLoader newLoader(SolrQueryRequest req, UpdateRequestProcessor processor) {
     return new SingleThreadedCSVLoader(req, processor);
   }
@@ -118,6 +119,7 @@ abstract class CSVLoader extends Content
 
   /** add zero length fields */
   private class FieldAdderEmpty extends CSVLoader.FieldAdder {
+    @Override
     void add(SolrInputDocument doc, int line, int column, String val) {
       doc.addField(fields[column].getName(),val,1.0f);
     }
@@ -127,6 +129,7 @@ abstract class CSVLoader extends Content
   private class FieldTrimmer extends CSVLoader.FieldAdder {
     private final CSVLoader.FieldAdder base;
     FieldTrimmer(CSVLoader.FieldAdder base) { this.base=base; }
+    @Override
     void add(SolrInputDocument doc, int line, int column, String val) {
       base.add(doc, line, column, val.trim());
     }
@@ -145,6 +148,7 @@ abstract class CSVLoader extends Content
      this.to=to;
      this.base=base;
    }
+    @Override
     void add(SolrInputDocument doc, int line, int column, String val) {
       if (from.equals(val)) val=to;
       base.add(doc,line,column,val);
@@ -162,6 +166,7 @@ abstract class CSVLoader extends Content
       this.base = base;
     }
 
+    @Override
     void add(SolrInputDocument doc, int line, int column, String val) {
       CSVParser parser = new CSVParser(new StringReader(val), strategy);
       try {
@@ -305,13 +310,29 @@ abstract class CSVLoader extends Content
 
   private void input_err(String msg, String[] line, int lineno) {
     StringBuilder sb = new StringBuilder();
-    sb.append(errHeader+", line="+lineno + ","+msg+"\n\tvalues={");
-    for (String val: line) { sb.append("'"+val+"',"); }
+    sb.append(errHeader).append(", line=").append(lineno).append(",").append(msg).append("\n\tvalues={");
+    for (String val: line) {
+      sb.append("'").append(val).append("',"); }
     sb.append('}');
     throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,sb.toString());
   }
 
+  private void input_err(String msg, String[] lines, int lineNo, Throwable e) {
+    StringBuilder sb = new StringBuilder();
+    sb.append(errHeader).append(", line=").append(lineNo).append(",").append(msg).append("\n\tvalues={");
+    if (lines != null) {
+      for (String val : lines) {
+        sb.append("'").append(val).append("',");
+      }
+    } else {
+      sb.append("NO LINES AVAILABLE");
+    }
+    sb.append('}');
+    throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,sb.toString(), e);
+  }
+
   /** load the CSV input */
+  @Override
   public void load(SolrQueryRequest req, SolrQueryResponse rsp, ContentStream stream) throws IOException {
     errHeader = "CSVLoader: input=" + stream.getSourceInfo();
     Reader reader = null;
@@ -341,7 +362,13 @@ abstract class CSVLoader extends Content
       // read the rest of the CSV file
       for(;;) {
         int line = parser.getLineNumber();  // for error reporting in MT mode
-        String[] vals = parser.getLine();
+        String[] vals = null;
+        try {
+          vals = parser.getLine();
+        } catch (IOException e) {
+          //Catch the exception and rethrow it with more line information
+         input_err("can't read line: " + line, null, line, e);
+        }
         if (vals==null) break;
 
         if (vals.length != fields.length) {
@@ -382,6 +409,7 @@ class SingleThreadedCSVLoader extends CS
     super(req, processor);
   }
 
+  @Override
   void addDoc(int line, String[] vals) throws IOException {
     templateAdd.indexedId = null;
     SolrInputDocument doc = new SolrInputDocument();

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java Tue Feb 22 01:00:39 2011
@@ -32,6 +32,7 @@ import org.apache.solr.update.processor.
  **/
 public abstract class ContentStreamHandlerBase extends RequestHandlerBase {
 
+  @Override
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
     SolrParams params = req.getParams();
     UpdateRequestProcessorChain processorChain =

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -27,6 +27,7 @@ import org.apache.solr.common.params.Ana
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.ContentStream;
+import org.apache.solr.common.util.ContentStreamBase;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.request.SolrQueryRequest;
@@ -41,7 +42,7 @@ import javax.xml.stream.XMLStreamConstan
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import java.io.IOException;
-import java.io.Reader;
+import java.io.InputStream;
 import java.util.*;
 
 /**
@@ -105,6 +106,7 @@ public class DocumentAnalysisRequestHand
   /**
    * {@inheritDoc}
    */
+  @Override
   protected NamedList doAnalysis(SolrQueryRequest req) throws Exception {
     DocumentAnalysisRequest analysisRequest = resolveAnalysisRequest(req);
     return handleAnalysisRequest(analysisRequest, req.getSchema());
@@ -156,10 +158,14 @@ public class DocumentAnalysisRequestHand
     request.setShowMatch(showMatch);
 
     ContentStream stream = extractSingleContentStream(req);
-    Reader reader = stream.getReader();
-    XMLStreamReader parser = inputFactory.createXMLStreamReader(reader);
-
+    InputStream is = null;
+    XMLStreamReader parser = null;
+    
     try {
+      is = stream.getStream();
+      final String charset = ContentStreamBase.getCharsetFromContentType(stream.getContentType());
+      parser = (charset == null) ?
+        inputFactory.createXMLStreamReader(is) : inputFactory.createXMLStreamReader(is, charset);
 
       while (true) {
         int event = parser.next();
@@ -181,8 +187,8 @@ public class DocumentAnalysisRequestHand
       }
 
     } finally {
-      parser.close();
-      IOUtils.closeQuietly(reader);
+      if (parser != null) parser.close();
+      IOUtils.closeQuietly(is);
     }
   }
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -18,7 +18,7 @@
 package org.apache.solr.handler;
 
 import java.io.IOException;
-import java.io.InputStream;
+import java.io.Reader;
 import java.util.ArrayList;
 
 import org.apache.commons.io.IOUtils;
@@ -46,11 +46,11 @@ public class DumpRequestHandler extends 
         stream.add( "sourceInfo", content.getSourceInfo() );
         stream.add( "size", content.getSize() );
         stream.add( "contentType", content.getContentType() );
-        InputStream is = content.getStream();
+        Reader reader = content.getReader();
         try {
-          stream.add( "stream", IOUtils.toString(is) );
+          stream.add( "stream", IOUtils.toString(reader) );
         } finally {
-          is.close();
+          reader.close();
         }
         streams.add( stream );
       }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -94,6 +94,7 @@ public class FieldAnalysisRequestHandler
   /**
    * {@inheritDoc}
    */
+  @Override
   protected NamedList doAnalysis(SolrQueryRequest req) throws Exception {
     FieldAnalysisRequest analysisRequest = resolveAnalysisRequest(req);
     IndexSchema indexSchema = req.getCore().getSchema();

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonUpdateRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonUpdateRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonUpdateRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonUpdateRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -35,6 +35,7 @@ public class JsonUpdateRequestHandler ex
     super.init(args);
   }
 
+  @Override
   protected ContentStreamLoader newLoader(SolrQueryRequest req, UpdateRequestProcessor processor) {
     return new JsonLoader(processor);
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java Tue Feb 22 01:00:39 2011
@@ -232,7 +232,7 @@ public class MoreLikeThisHandler extends
     // Copied from StandardRequestHandler... perhaps it should be added to doStandardDebug?
     if (dbg == true) {
       try {
-        NamedList<Object> dbgInfo = SolrPluginUtils.doStandardDebug(req, q, mlt.mltquery, mltDocs.docList, dbgQuery, dbgResults);
+        NamedList<Object> dbgInfo = SolrPluginUtils.doStandardDebug(req, q, mlt.getRawMLTQuery(), mltDocs.docList, dbgQuery, dbgResults);
         if (null != dbgInfo) {
           if (null != filters) {
             dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
@@ -279,8 +279,6 @@ public class MoreLikeThisHandler extends
     final boolean needDocSet;
     Map<String,Float> boostFields;
     
-    Query mltquery;  // expose this for debugging
-    
     public MoreLikeThisHelper( SolrParams params, SolrIndexSearcher searcher )
     {
       this.searcher = searcher;
@@ -310,9 +308,26 @@ public class MoreLikeThisHandler extends
       boostFields = SolrPluginUtils.parseFieldBoosts(params.getParams(MoreLikeThisParams.QF));
     }
     
-    private void setBoosts(Query mltquery) {
+    private Query rawMLTQuery;
+    private Query boostedMLTQuery;
+    private BooleanQuery realMLTQuery;
+    
+    public Query getRawMLTQuery(){
+      return rawMLTQuery;
+    }
+    
+    public Query getBoostedMLTQuery(){
+      return boostedMLTQuery;
+    }
+    
+    public Query getRealMLTQuery(){
+      return realMLTQuery;
+    }
+    
+    private Query getBoostedQuery(Query mltquery) {
+      BooleanQuery boostedQuery = (BooleanQuery)mltquery.clone();
       if (boostFields.size() > 0) {
-        List clauses = ((BooleanQuery)mltquery).clauses();
+        List clauses = boostedQuery.clauses();
         for( Object o : clauses ) {
           TermQuery q = (TermQuery)((BooleanClause)o).getQuery();
           Float b = this.boostFields.get(q.getTerm().field());
@@ -321,49 +336,51 @@ public class MoreLikeThisHandler extends
           }
         }
       }
+      return boostedQuery;
     }
     
     public DocListAndSet getMoreLikeThis( int id, int start, int rows, List<Query> filters, List<InterestingTerm> terms, int flags ) throws IOException
     {
       Document doc = reader.document(id);
-      mltquery = mlt.like(id);
-      setBoosts(mltquery);
+      rawMLTQuery = mlt.like(id);
+      boostedMLTQuery = getBoostedQuery( rawMLTQuery );
       if( terms != null ) {
-        fillInterestingTermsFromMLTQuery( mltquery, terms );
+        fillInterestingTermsFromMLTQuery( rawMLTQuery, terms );
       }
 
       // exclude current document from results
-      BooleanQuery mltQuery = new BooleanQuery();
-      mltQuery.add(mltquery, BooleanClause.Occur.MUST);
-      mltQuery.add(
+      realMLTQuery = new BooleanQuery();
+      realMLTQuery.add(boostedMLTQuery, BooleanClause.Occur.MUST);
+      realMLTQuery.add(
           new TermQuery(new Term(uniqueKeyField.getName(), uniqueKeyField.getType().storedToIndexed(doc.getFieldable(uniqueKeyField.getName())))), 
             BooleanClause.Occur.MUST_NOT);
       
       DocListAndSet results = new DocListAndSet();
       if (this.needDocSet) {
-        results = searcher.getDocListAndSet(mltQuery, filters, null, start, rows, flags);
+        results = searcher.getDocListAndSet(realMLTQuery, filters, null, start, rows, flags);
       } else {
-        results.docList = searcher.getDocList(mltQuery, filters, null, start, rows, flags);
+        results.docList = searcher.getDocList(realMLTQuery, filters, null, start, rows, flags);
       }
       return results;
     }
 
     public DocListAndSet getMoreLikeThis( Reader reader, int start, int rows, List<Query> filters, List<InterestingTerm> terms, int flags ) throws IOException
     {
-      mltquery = mlt.like(reader);
-      setBoosts(mltquery);
+      rawMLTQuery = mlt.like(reader);
+      boostedMLTQuery = getBoostedQuery( rawMLTQuery );
       if( terms != null ) {
-        fillInterestingTermsFromMLTQuery( mltquery, terms );
+        fillInterestingTermsFromMLTQuery( boostedMLTQuery, terms );
       }
       DocListAndSet results = new DocListAndSet();
       if (this.needDocSet) {
-        results = searcher.getDocListAndSet(mltquery, filters, null, start, rows, flags);
+        results = searcher.getDocListAndSet( boostedMLTQuery, filters, null, start, rows, flags);
       } else {
-        results.docList = searcher.getDocList(mltquery, filters, null, start, rows, flags);
+        results.docList = searcher.getDocList( boostedMLTQuery, filters, null, start, rows, flags);
       }
       return results;
     }
-    
+
+    @Deprecated
     public NamedList<DocList> getMoreLikeThese( DocList docs, int rows, int flags ) throws IOException
     {
       IndexSchema schema = searcher.getSchema();
@@ -382,7 +399,7 @@ public class MoreLikeThisHandler extends
     
     private void fillInterestingTermsFromMLTQuery( Query query, List<InterestingTerm> terms )
     { 
-      List clauses = ((BooleanQuery)mltquery).clauses();
+      List clauses = ((BooleanQuery)query).clauses();
       for( Object o : clauses ) {
         TermQuery q = (TermQuery)((BooleanClause)o).getQuery();
         InterestingTerm it = new InterestingTerm();

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java Tue Feb 22 01:00:39 2011
@@ -98,6 +98,7 @@ public class ReplicationHandler extends 
 
   private AtomicBoolean replicationEnabled = new AtomicBoolean(true);
 
+  @Override
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
     rsp.setHttpCaching(false);
     final SolrParams solrParams = req.getParams();
@@ -143,6 +144,7 @@ public class ReplicationHandler extends 
       }
       final SolrParams paramsCopy = new ModifiableSolrParams(solrParams);
       new Thread() {
+        @Override
         public void run() {
           doFetch(paramsCopy);
         }
@@ -447,18 +449,22 @@ public class ReplicationHandler extends 
     return fileMeta;
   }
 
+  @Override
   public String getDescription() {
     return "ReplicationHandler provides replication of index and configuration files from Master to Slaves";
   }
 
+  @Override
   public String getSourceId() {
     return "$Id$";
   }
 
+  @Override
   public String getSource() {
     return "$URL$";
   }
 
+  @Override
   public String getVersion() {
     return "$Revision$";
   }
@@ -687,12 +693,12 @@ public class ReplicationHandler extends 
           LOG.error("Exception while writing replication details: ", e);
         }
       }
-      if (isMaster)
-        details.add("master", master);
-      if (isSlave && showSlaveDetails)
-        details.add("slave", slave);
-
     }
+
+    if (isMaster)
+      details.add("master", master);
+    if (isSlave && showSlaveDetails)
+      details.add("slave", slave);
     
     NamedList snapshotStats = snapShootDetails;
     if (snapshotStats != null)

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerUtils.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerUtils.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerUtils.java Tue Feb 22 01:00:39 2011
@@ -49,7 +49,7 @@ public class RequestHandlerUtils
    * Check the request parameters and decide if it should commit or optimize.
    * If it does, it will check parameters for "waitFlush" and "waitSearcher"
    * 
-   * @deprecated Use {@link #handleCommit(UpdateRequestProcessor,SolrParams,boolean)}
+   * @deprecated Use {@link #handleCommit(SolrQueryRequest,UpdateRequestProcessor,SolrParams,boolean)}
    *
    * @since solr 1.2
    */

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java Tue Feb 22 01:00:39 2011
@@ -300,15 +300,17 @@ public class SnapPuller {
         isFullCopyNeeded = true;
       successfulInstall = false;
       boolean deleteTmpIdxDir = true;
+      File indexDir = null ;
       try {
-        File indexDir = new File(core.getIndexDir());
+        indexDir = new File(core.getIndexDir());
         downloadIndexFiles(isFullCopyNeeded, tmpIndexDir, latestVersion);
         LOG.info("Total time taken for download : " + ((System.currentTimeMillis() - replicationStartTime) / 1000) + " secs");
         Collection<Map<String, Object>> modifiedConfFiles = getModifiedConfFiles(confFilesToDownload);
         if (!modifiedConfFiles.isEmpty()) {
           downloadConfFiles(confFilesToDownload, latestVersion);
           if (isFullCopyNeeded) {
-            modifyIndexProps(tmpIndexDir.getName());
+            successfulInstall = modifyIndexProps(tmpIndexDir.getName());
+            deleteTmpIdxDir =  false;
           } else {
             successfulInstall = copyIndexFiles(tmpIndexDir, indexDir);
           }
@@ -339,7 +341,8 @@ public class SnapPuller {
       } catch (Exception e) {
         throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Index fetch failed : ", e);
       } finally {
-        if(deleteTmpIdxDir) delTree(tmpIndexDir);
+        if (deleteTmpIdxDir) delTree(tmpIndexDir);
+        else delTree(indexDir);
       }
       return successfulInstall;
     } finally {
@@ -505,6 +508,7 @@ public class SnapPuller {
 
   private void reloadCore() {
     new Thread() {
+      @Override
       public void run() {
         try {
           solrCore.getCoreDescriptor().getCoreContainer().reload(solrCore.getName());

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java Tue Feb 22 01:00:39 2011
@@ -64,6 +64,7 @@ public class SnapShooter {
     replicationHandler.core.getDeletionPolicy().saveCommitPoint(indexCommit.getVersion());
 
     new Thread() {
+      @Override
       public void run() {
         createSnapshot(indexCommit, replicationHandler);
       }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XMLLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XMLLoader.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XMLLoader.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XMLLoader.java Tue Feb 22 01:00:39 2011
@@ -24,6 +24,7 @@ import org.apache.solr.update.DeleteUpda
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.common.util.ContentStream;
+import org.apache.solr.common.util.ContentStreamBase;
 import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrInputDocument;
@@ -36,8 +37,8 @@ import javax.xml.stream.FactoryConfigura
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.transform.TransformerConfigurationException;
-import java.io.Reader;
-import java.io.StringReader;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.io.IOException;
 
 
@@ -54,24 +55,31 @@ class XMLLoader extends ContentStreamLoa
     this.inputFactory = inputFactory;
   }
 
+  @Override
   public void load(SolrQueryRequest req, SolrQueryResponse rsp, ContentStream stream) throws Exception {
     errHeader = "XMLLoader: " + stream.getSourceInfo();
-    Reader reader = null;
+    InputStream is = null;
+    XMLStreamReader parser = null;
     try {
-      reader = stream.getReader();
+      is = stream.getStream();
+      final String charset = ContentStreamBase.getCharsetFromContentType(stream.getContentType());
       if (XmlUpdateRequestHandler.log.isTraceEnabled()) {
-        String body = IOUtils.toString(reader);
-        XmlUpdateRequestHandler.log.trace("body", body);
-        reader = new StringReader(body);
+        final byte[] body = IOUtils.toByteArray(is);
+        // TODO: The charset may be wrong, as the real charset is later
+        // determined by the XML parser, the content-type is only used as a hint!
+        XmlUpdateRequestHandler.log.trace("body", new String(body, (charset == null) ?
+          ContentStreamBase.DEFAULT_CHARSET : charset));
+        IOUtils.closeQuietly(is);
+        is = new ByteArrayInputStream(body);
       }
-
-      XMLStreamReader parser = inputFactory.createXMLStreamReader(reader);
+      parser = (charset == null) ?
+        inputFactory.createXMLStreamReader(is) : inputFactory.createXMLStreamReader(is, charset);
       this.processUpdate(req, processor, parser);
-    }
-    catch (XMLStreamException e) {
+    } catch (XMLStreamException e) {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e.getMessage(), e);
     } finally {
-      IOUtils.closeQuietly(reader);
+      if (parser != null) parser.close();
+      IOUtils.closeQuietly(is);
     }
   }
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -80,6 +80,7 @@ public class XmlUpdateRequestHandler ext
     }
   }
 
+  @Override
   protected ContentStreamLoader newLoader(SolrQueryRequest req, UpdateRequestProcessor processor) {
     return new XMLLoader(processor, inputFactory);
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java Tue Feb 22 01:00:39 2011
@@ -210,7 +210,7 @@ public class ShowFileRequestHandler exte
     }
     try {
       InputStream input = core.getResourceLoader().openResource(path);
-      return IOUtils.toString( input );
+      return IOUtils.toString( input, "UTF-8" );
     }
     catch( Exception ex ) {} // ignore it
     return "";

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java Tue Feb 22 01:00:39 2011
@@ -1,5 +1,22 @@
 package org.apache.solr.handler.admin;
 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.solr.handler.RequestHandlerBase;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.core.SolrInfoMBean;
@@ -32,6 +49,7 @@ public class SolrInfoMBeanHandler extend
   }
   
 
+  @Override
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
     SolrCore core = req.getCore();
     
@@ -77,18 +95,22 @@ public class SolrInfoMBeanHandler extend
     rsp.setHttpCaching(false); // never cache, no matter what init config looks like
   }
 
+  @Override
   public String getDescription() {
     return "Get Info (and statistics) about all registered SolrInfoMBeans";
   }
 
+  @Override
   public String getSourceId() {
     return "$Id$";
   }
 
+  @Override
   public String getSource() {
     return "$URL$";
   }
 
+  @Override
   public String getVersion() {
     return "$Revision$";
   }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java Tue Feb 22 01:00:39 2011
@@ -185,6 +185,7 @@ public class SystemInfoHandler extends R
     try {
       Process process = Runtime.getRuntime().exec(cmd);
       in = new DataInputStream( process.getInputStream() );
+      // use default charset from locale here, because the command invoked also uses the default locale:
       return IOUtils.toString( in );
     }
     catch( Exception ex ) {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/DebugComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/DebugComponent.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/DebugComponent.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/DebugComponent.java Tue Feb 22 01:00:39 2011
@@ -86,6 +86,7 @@ public class DebugComponent extends Sear
   }
 
 
+  @Override
   public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) {
     if (!rb.isDebug()) return;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/FacetComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/FacetComponent.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/FacetComponent.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/FacetComponent.java Tue Feb 22 01:00:39 2011
@@ -726,6 +726,7 @@ public class FacetComponent extends Sear
     public long count;
     public int termNum;  // term number starting at 0 (used in bit arrays)
 
+    @Override
     public String toString() {
       return "{term="+name+",termNum="+termNum+",count="+count+"}";
     }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/HighlightComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/HighlightComponent.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/HighlightComponent.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/HighlightComponent.java Tue Feb 22 01:00:39 2011
@@ -131,6 +131,7 @@ public class HighlightComponent extends 
     }
   }
 
+  @Override
   public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) {
     if (!rb.doHighlights) return;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java Tue Feb 22 01:00:39 2011
@@ -23,8 +23,12 @@ import java.net.URL;
 import org.apache.solr.common.params.MoreLikeThisParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.handler.MoreLikeThisHandler;
+import org.apache.solr.schema.IndexSchema;
+import org.apache.solr.search.DocIterator;
 import org.apache.solr.search.DocList;
+import org.apache.solr.search.DocListAndSet;
 import org.apache.solr.search.SolrIndexSearcher;
 
 /**
@@ -50,18 +54,59 @@ public class MoreLikeThisComponent exten
     if( p.getBool( MoreLikeThisParams.MLT, false ) ) {
       SolrIndexSearcher searcher = rb.req.getSearcher();
       
-      MoreLikeThisHandler.MoreLikeThisHelper mlt 
-        = new MoreLikeThisHandler.MoreLikeThisHelper( p, searcher );
-      
-      int mltcount = p.getInt( MoreLikeThisParams.DOC_COUNT, 5 );
-      NamedList<DocList> sim = mlt.getMoreLikeThese(
-          rb.getResults().docList, mltcount, rb.getFieldFlags() );
+      NamedList<DocList> sim = getMoreLikeThese( rb, searcher,
+          rb.getResults().docList, rb.getFieldFlags() );
 
       // TODO ???? add this directly to the response?
       rb.rsp.add( "moreLikeThis", sim );
     }
   }
 
+  NamedList<DocList> getMoreLikeThese( ResponseBuilder rb, SolrIndexSearcher searcher,
+      DocList docs, int flags ) throws IOException {
+    SolrParams p = rb.req.getParams();
+    IndexSchema schema = searcher.getSchema();
+    MoreLikeThisHandler.MoreLikeThisHelper mltHelper 
+      = new MoreLikeThisHandler.MoreLikeThisHelper( p, searcher );
+    NamedList<DocList> mlt = new SimpleOrderedMap<DocList>();
+    DocIterator iterator = docs.iterator();
+
+    SimpleOrderedMap<Object> dbg = null;
+    if( rb.isDebug() ){
+      dbg = new SimpleOrderedMap<Object>();
+    }
+
+    while( iterator.hasNext() ) {
+      int id = iterator.nextDoc();
+      int rows = p.getInt( MoreLikeThisParams.DOC_COUNT, 5 );
+      DocListAndSet sim = mltHelper.getMoreLikeThis( id, 0, rows, null, null, flags );
+      String name = schema.printableUniqueKey( searcher.doc( id ) );
+      mlt.add(name, sim.docList);
+      
+      if( dbg != null ){
+        SimpleOrderedMap<Object> docDbg = new SimpleOrderedMap<Object>();
+        docDbg.add( "rawMLTQuery", mltHelper.getRawMLTQuery().toString() );
+        docDbg.add( "boostedMLTQuery", mltHelper.getBoostedMLTQuery().toString() );
+        docDbg.add( "realMLTQuery", mltHelper.getRealMLTQuery().toString() );
+        SimpleOrderedMap<Object> explains = new SimpleOrderedMap<Object>();
+        DocIterator mltIte = sim.docList.iterator();
+        while( mltIte.hasNext() ){
+          int mltid = mltIte.nextDoc();
+          String key = schema.printableUniqueKey( searcher.doc( mltid ) );
+          explains.add( key, searcher.explain( mltHelper.getRealMLTQuery(), mltid ) );
+        }
+        docDbg.add( "explain", explains );
+        dbg.add( name, docDbg );
+      }
+    }
+
+    // add debug information
+    if( dbg != null ){
+      rb.addDebugInfo( "moreLikeThis", dbg );
+    }
+    return mlt;
+  }
+  
   /////////////////////////////////////////////
   ///  SolrInfoMBean
   ////////////////////////////////////////////

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/PivotFacetHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/PivotFacetHelper.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/PivotFacetHelper.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/PivotFacetHelper.java Tue Feb 22 01:00:39 2011
@@ -102,7 +102,7 @@ public class PivotFacetHelper
     List<NamedList<Object>> values = new ArrayList<NamedList<Object>>( superFacets.size() );
     for (Map.Entry<String, Integer> kv : superFacets) {
       // Only sub-facet if parent facet has positive count - still may not be any values for the sub-field though
-      if (kv.getValue() > minMatch ) {
+      if (kv.getValue() >= minMatch ) {
         // don't reuse the same BytesRef  each time since we will be constructing Term
         // objects that will most likely be cached.
         BytesRef termval = new BytesRef();
@@ -122,7 +122,7 @@ public class PivotFacetHelper
           SimpleFacets sf = getFacetImplementation(rb.req, subset, rb.req.getParams());
           
           NamedList<Integer> nl = sf.getTermCounts(subField);
-          if (nl.size() > minMatch ) {
+          if (nl.size() >= minMatch ) {
             pivot.add( "pivot", doPivots( nl, subField, nextField, fnames, rb, subset, minMatch ) );
             values.add( pivot ); // only add response if there are some counts
           }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1073192&r1=1073191&r2=1073192&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/component/QueryComponent.java Tue Feb 22 01:00:39 2011
@@ -107,7 +107,6 @@ public class QueryComponent extends Sear
         List<Query> filters = rb.getFilters();
         if (filters==null) {
           filters = new ArrayList<Query>(fqs.length);
-          rb.setFilters( filters );
         }
         for (String fq : fqs) {
           if (fq != null && fq.trim().length()!=0) {
@@ -115,6 +114,12 @@ public class QueryComponent extends Sear
             filters.add(fqp.getQuery());
           }
         }
+        // only set the filters if they are not empty otherwise
+        // fq=&someotherParam= will trigger all docs filter for every request 
+        // if filter cache is disabled
+        if (!filters.isEmpty()) {
+          rb.setFilters( filters );
+        }
       }
     } catch (ParseException e) {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);



Mime
View raw message