lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r1054507 [6/9] - in /lucene/dev/branches/realtime_search: ./ dev-tools/ dev-tools/eclipse/ dev-tools/idea/ dev-tools/idea/.idea/ dev-tools/idea/.idea/libraries/ dev-tools/idea/lucene/ dev-tools/idea/lucene/contrib/ dev-tools/idea/lucene/con...
Date Mon, 03 Jan 2011 00:30:45 GMT
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DisMaxQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DisMaxQParserPlugin.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DisMaxQParserPlugin.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DisMaxQParserPlugin.java Mon Jan  3 00:30:27 2011
@@ -22,10 +22,92 @@ import org.apache.solr.request.SolrQuery
 
 /**
  * Create a dismax query from the input value.
- * <br>Other parameters: all main query related parameters from the {@link org.apache.solr.handler.DisMaxRequestHandler} are supported.
- * localParams are checked before global request params.
+ * <br>localParams are checked before global request params.
  * <br>Example: <code>{!dismax qf='myfield mytitle^2'}foo</code> creates a dismax query across
  * across myfield and mytitle, with a higher weight on mytitle.
+ *
+  * <p>
+  * A Generic query plugin designed to be given a simple query expression
+  * from a user, which it will then query against a variety of
+  * pre-configured fields, in a variety of ways, using BooleanQueries,
+  * DisjunctionMaxQueries, and PhraseQueries.
+  * </p>
+  *
+  * <p>
+  * All of the following options may be configured for this plugin
+  * in the solrconfig as defaults, and may be overriden as request parameters
+  * </p>
+  *
+  * <ul>
+  * <li>q.alt - An alternate query to be used in cases where the main
+  *             query (q) is not specified (or blank).  This query should
+  *             be expressed in the Standard SolrQueryParser syntax (you
+  *             can use <code>q.alt=*:*</code> to denote that all documents
+  *             should be returned when no query is specified)
+  * </li>
+  * <li>tie - (Tie breaker) float value to use as tiebreaker in
+  *           DisjunctionMaxQueries (should be something much less than 1)
+  * </li>
+  * <li> qf - (Query Fields) fields and boosts to use when building
+  *           DisjunctionMaxQueries from the users query.  Format is:
+  *           "<code>fieldA^1.0 fieldB^2.2</code>".
+  *           This param can be specified multiple times, and the fields
+  *           are additive.
+  * </li>
+  * <li> mm - (Minimum Match) this supports a wide variety of
+  *           complex expressions.
+  *           read {@link org.apache.solr.util.SolrPluginUtils#setMinShouldMatch SolrPluginUtils.setMinShouldMatch} and <a href="http://lucene.apache.org/solr/api/org/apache/solr/util/doc-files/min-should-match.html">mm expression format</a> for details.
+  * </li>
+  * <li> pf - (Phrase Fields) fields/boosts to make phrase queries out
+  *           of, to boost the users query for exact matches on the specified fields.
+  *           Format is: "<code>fieldA^1.0 fieldB^2.2</code>".
+  *           This param can be specified multiple times, and the fields
+  *           are additive.
+  * </li>
+  * <li> ps - (Phrase Slop) amount of slop on phrase queries built for pf
+  *           fields.
+  * </li>
+  * <li> qs - (Query Slop) amount of slop on phrase queries explicitly
+  *           specified in the "q" for qf fields.
+  * </li>
+  * <li> bq - (Boost Query) a raw lucene query that will be included in the
+  *           users query to influence the score.  If this is a BooleanQuery
+  *           with a default boost (1.0f), then the individual clauses will be
+  *           added directly to the main query.  Otherwise, the query will be
+  *           included as is.
+  *           This param can be specified multiple times, and the boosts are
+  *           are additive.  NOTE: the behaviour listed above is only in effect
+  *           if a single <code>bq</code> paramter is specified.  Hence you can
+  *           disable it by specifying an additional, blank, <code>bq</code>
+  *           parameter.
+  * </li>
+  * <li> bf - (Boost Functions) functions (with optional boosts) that will be
+  *           included in the users query to influence the score.
+  *           Format is: "<code>funcA(arg1,arg2)^1.2
+  *           funcB(arg3,arg4)^2.2</code>".  NOTE: Whitespace is not allowed
+  *           in the function arguments.
+  *           This param can be specified multiple times, and the functions
+  *           are additive.
+  * </li>
+  * <li> fq - (Filter Query) a raw lucene query that can be used
+  *           to restrict the super set of products we are interested in - more
+  *           efficient then using bq, but doesn't influence score.
+  *           This param can be specified multiple times, and the filters
+  *           are additive.
+  * </li>
+  * </ul>
+  *
+  * <p>
+  * The following options are only available as request params...
+  * </p>
+  *
+  * <ul>
+  * <li>   q - (Query) the raw unparsed, unescaped, query from the user.
+  * </li>
+  * <li>sort - (Order By) list of fields and direction to sort on.
+  * </li>
+  * </ul>
+ *
  */
 public class DisMaxQParserPlugin extends QParserPlugin {
   public static String NAME = "dismax";

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DocSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DocSet.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DocSet.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/DocSet.java Mon Jan  3 00:30:27 2011
@@ -89,10 +89,7 @@ public interface DocSet /* extends Colle
    *
    * @return
    * An OpenBitSet with the bit number of every docid set in the set.
-   * 
-   * @deprecated Use {@link #iterator()} to access all docs instead.
    */
-  @Deprecated
   public OpenBitSet getBits();
 
   /**

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java Mon Jan  3 00:30:27 2011
@@ -27,7 +27,6 @@ import org.apache.lucene.queryParser.Que
 import org.apache.lucene.search.*;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
-import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.DefaultSolrParams;
 import org.apache.solr.common.params.DisMaxParams;
 import org.apache.solr.common.params.SolrParams;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FieldQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FieldQParserPlugin.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FieldQParserPlugin.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FieldQParserPlugin.java Mon Jan  3 00:30:27 2011
@@ -16,24 +16,14 @@
  */
 package org.apache.solr.search;
 
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.Token;
-import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.index.Term;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.*;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.SolrException;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.schema.FieldType;
-import org.apache.solr.schema.TextField;
 import org.apache.solr.schema.SchemaField;
 
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-
 
 /**
  * Create a field query from the input value, applying text analysis and constructing a phrase query if appropriate.

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java Mon Jan  3 00:30:27 2011
@@ -18,8 +18,6 @@ package org.apache.solr.search;
 
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.ConstantScoreQuery;
-import org.apache.lucene.search.Filter;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.request.SolrQueryRequest;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQParserPlugin.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQParserPlugin.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQParserPlugin.java Mon Jan  3 00:30:27 2011
@@ -17,7 +17,6 @@
 package org.apache.solr.search;
 
 import org.apache.lucene.queryParser.ParseException;
-import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Sort;
 import org.apache.solr.common.SolrException;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQueryOptimizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQueryOptimizer.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQueryOptimizer.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/LuceneQueryOptimizer.java Mon Jan  3 00:30:27 2011
@@ -24,7 +24,6 @@ package org.apache.solr.search;
 import org.apache.lucene.search.*;
 
 import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.io.IOException;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/NestedQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/NestedQParserPlugin.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/NestedQParserPlugin.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/NestedQParserPlugin.java Mon Jan  3 00:30:27 2011
@@ -21,9 +21,6 @@ import org.apache.lucene.search.Query;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.search.function.BoostedQuery;
-import org.apache.solr.search.function.FunctionQuery;
-import org.apache.solr.search.function.QueryValueSource;
 import org.apache.solr.search.function.ValueSource;
 
 /**

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryParsing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryParsing.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryParsing.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryParsing.java Mon Jan  3 00:30:27 2011
@@ -19,7 +19,6 @@ package org.apache.solr.search;
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queryParser.ParseException;
-import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.queryParser.QueryParser.Operator;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
@@ -44,14 +43,11 @@ import org.apache.solr.schema.IndexSchem
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.search.function.FunctionQuery;
 import org.apache.solr.search.function.QueryValueSource;
-import org.apache.solr.search.function.ValueSource;
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.regex.Pattern;
 
 /**
  * Collection of static utilities useful for query parsing.
@@ -87,68 +83,6 @@ public class QueryParsing {
     if (null == val) val = sch.getQueryParserDefaultOperator();
     return "AND".equals(val) ? Operator.AND : Operator.OR;
   }
-   
-
-
-  /**
-   * Helper utility for parsing a query using the Lucene QueryParser syntax.
-   *
-   * @param qs     query expression in standard Lucene syntax
-   * @param schema used for default operator (overridden by params) and passed to the query parser for field format analysis information
-   */
-  public static Query parseQuery(String qs, IndexSchema schema) {
-    return parseQuery(qs, null, schema);
-  }
-
-  /**
-   * Helper utility for parsing a query using the Lucene QueryParser syntax.
-   *
-   * @param qs           query expression in standard Lucene syntax
-   * @param defaultField default field used for unqualified search terms in the query expression
-   * @param schema       used for default operator (overridden by params) and passed to the query parser for field format analysis information
-   */
-  public static Query parseQuery(String qs, String defaultField, IndexSchema schema) {
-    try {
-      Query query = schema.getSolrQueryParser(defaultField).parse(qs);
-
-      if (SolrCore.log.isTraceEnabled()) {
-        SolrCore.log.trace("After QueryParser:" + query);
-      }
-
-      return query;
-
-    } catch (ParseException e) {
-      SolrCore.log(e);
-      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Error parsing Lucene query", e);
-    }
-  }
-
-  /**
-   * Helper utility for parsing a query using the Lucene QueryParser syntax.
-   *
-   * @param qs           query expression in standard Lucene syntax
-   * @param defaultField default field used for unqualified search terms in the query expression
-   * @param params       used to determine the default operator, overriding the schema specified operator
-   * @param schema       used for default operator (overridden by params) and passed to the query parser for field format analysis information
-   */
-  public static Query parseQuery(String qs, String defaultField, SolrParams params, IndexSchema schema) {
-    try {
-      SolrQueryParser parser = schema.getSolrQueryParser(defaultField);
-      parser.setDefaultOperator(getQueryParserDefaultOperator
-                                (schema, params.get(QueryParsing.OP)));
-      Query query = parser.parse(qs);
-
-      if (SolrCore.log.isTraceEnabled()) {
-        SolrCore.log.trace("After QueryParser:" + query);
-      }
-
-      return query;
-
-    } catch (ParseException e) {
-      SolrCore.log(e);
-      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Query parsing error: " + e.getMessage(), e);
-    }
-  }
 
 
   // note to self: something needs to detect infinite recursion when parsing queries
@@ -911,45 +845,4 @@ public class QueryParsing {
     return out;
   }
 
-  /**
-   * Parse a function, returning a FunctionQuery
-   * <p/>
-   * <p>
-   * Syntax Examples....
-   * </p>
-   * <p/>
-   * <pre>
-   * // Numeric fields default to correct type
-   * // (ie: IntFieldSource or FloatFieldSource)
-   * // Others use explicit ord(...) to generate numeric field value
-   * myfield
-   * <p/>
-   * // OrdFieldSource
-   * ord(myfield)
-   * <p/>
-   * // ReverseOrdFieldSource
-   * rord(myfield)
-   * <p/>
-   * // LinearFloatFunction on numeric field value
-   * linear(myfield,1,2)
-   * <p/>
-   * // MaxFloatFunction of LinearFloatFunction on numeric field value or constant
-   * max(linear(myfield,1,2),100)
-   * <p/>
-   * // ReciprocalFloatFunction on numeric field value
-   * recip(myfield,1,2,3)
-   * <p/>
-   * // ReciprocalFloatFunction on ReverseOrdFieldSource
-   * recip(rord(myfield),1,2,3)
-   * <p/>
-   * // ReciprocalFloatFunction on LinearFloatFunction on ReverseOrdFieldSource
-   * recip(linear(rord(myfield),1,2),3,4,5)
-   * </pre>
-   */
-  public static FunctionQuery parseFunction(String func, IndexSchema schema) throws ParseException {
-    SolrCore core = SolrCore.getSolrCore();
-    return (FunctionQuery) (QParser.getParser(func, "func", new LocalSolrQueryRequest(core, new HashMap())).parse());
-    // return new FunctionQuery(parseValSource(new StrParser(func), schema));
-  }
-
 }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryResultKey.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryResultKey.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryResultKey.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/QueryResultKey.java Mon Jan  3 00:30:27 2011
@@ -17,13 +17,9 @@
 
 package org.apache.solr.search;
 
-import org.apache.lucene.search.FieldComparator;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.SortField;
-import org.apache.solr.common.SolrException.ErrorCode;
-import org.apache.solr.common.SolrException;
-
 import java.io.IOException;
 import java.util.List;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrCacheBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrCacheBase.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrCacheBase.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrCacheBase.java Mon Jan  3 00:30:27 2011
@@ -17,16 +17,6 @@
 
 package org.apache.solr.search;
 
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.core.SolrCore;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicLong;
-import java.io.IOException;
-import java.net.URL;
-
 /**
  * Common base class of reusable functionality for SolrCaches
  */

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java Mon Jan  3 00:30:27 2011
@@ -35,7 +35,6 @@ import org.apache.solr.core.SolrInfoMBea
 import org.apache.solr.request.UnInvertedField;
 import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.schema.SchemaField;
-import org.apache.solr.search.function.ValueSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -95,14 +94,6 @@ public class SolrIndexSearcher extends I
   private final Collection<String> fieldNames;
   private Collection<String> storedHighlightFieldNames;
 
-  /** Creates a searcher searching the index in the named directory.
-   * 
-   * @deprecated use alternate constructor
-   */
-  @Deprecated
-  public SolrIndexSearcher(SolrCore core, IndexSchema schema, String name, String path, boolean enableCache) throws IOException {
-    this(core, schema,name, core.getIndexReaderFactory().newReader(core.getDirectoryFactory().open(path), false), true, enableCache);
-  }
 
   /*
    * Creates a searcher searching the index in the provided directory. Note:

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrQueryParser.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrQueryParser.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SolrQueryParser.java Mon Jan  3 00:30:27 2011
@@ -39,9 +39,6 @@ import org.apache.solr.schema.IndexSchem
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.schema.TextField;
 
-// TODO: implement the analysis of simple fields with
-// FieldType.toInternal() instead of going through the
-// analyzer.  Should lead to faster query parsing.
 
 /**
  * A variation on the Lucene QueryParser which knows about the field 
@@ -57,8 +54,6 @@ import org.apache.solr.schema.TextField;
  * If the magic field name "<code>_val_</code>" is used in a term or 
  * phrase query, the value is parsed as a function.
  * </p>
- *
- * @see QueryParsing#parseFunction
  */
 public class SolrQueryParser extends QueryParser {
   protected final IndexSchema schema;
@@ -67,32 +62,12 @@ public class SolrQueryParser extends Que
   protected final Map<String, ReversedWildcardFilterFactory> leadingWildcards =
     new HashMap<String, ReversedWildcardFilterFactory>();
 
-  /**
-   * Constructs a SolrQueryParser using the schema to understand the
-   * formats and datatypes of each field.  Only the defaultSearchField
-   * will be used from the IndexSchema (unless overridden),
-   * &lt;solrQueryParser&gt; will not be used.
-   * 
-   * @param schema Used for default search field name if defaultField is null and field information is used for analysis
-   * @param defaultField default field used for unspecified search terms.  if null, the schema default field is used
-   * @see IndexSchema#getDefaultSearchFieldName()
-   */
-  public SolrQueryParser(IndexSchema schema, String defaultField) {
-    super(schema.getSolrConfig().getLuceneVersion("luceneMatchVersion", Version.LUCENE_30), defaultField == null ? schema.getDefaultSearchFieldName() : defaultField, schema.getQueryAnalyzer());
-    this.schema = schema;
-    this.parser  = null;
-    this.defaultField = defaultField;
-    setLowercaseExpandedTerms(false);
-    setEnablePositionIncrements(true);
-    checkAllowLeadingWildcards();
-  }
-
   public SolrQueryParser(QParser parser, String defaultField) {
     this(parser, defaultField, parser.getReq().getSchema().getQueryAnalyzer());
   }
 
   public SolrQueryParser(QParser parser, String defaultField, Analyzer analyzer) {
-    super(parser.getReq().getSchema().getSolrConfig().getLuceneVersion("luceneMatchVersion", Version.LUCENE_30), defaultField, analyzer);
+    super(parser.getReq().getCore().getSolrConfig().getLuceneVersion("luceneMatchVersion", Version.LUCENE_30), defaultField, analyzer);
     this.schema = parser.getReq().getSchema();
     this.parser = parser;
     this.defaultField = defaultField;
@@ -138,12 +113,8 @@ public class SolrQueryParser extends Que
     // own functions.
     if (field.charAt(0) == '_') {
       if ("_val_".equals(field)) {
-        if (parser==null) {
-          return QueryParsing.parseFunction(queryText, schema);
-        } else {
-          QParser nested = parser.subQuery(queryText, "func");
-          return nested.getQuery();
-        }
+        QParser nested = parser.subQuery(queryText, "func");
+        return nested.getQuery();
       } else if ("_query_".equals(field) && parser != null) {
         return parser.subQuery(queryText, null).getQuery();
       }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SpatialFilterQParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SpatialFilterQParser.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SpatialFilterQParser.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/SpatialFilterQParser.java Mon Jan  3 00:30:27 2011
@@ -22,7 +22,6 @@ import org.apache.lucene.search.Query;
 import org.apache.lucene.spatial.geometry.DistanceUnits;
 import org.apache.lucene.spatial.DistanceUtils;
 import org.apache.solr.common.SolrException;
-import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.params.SpatialParams;
 import org.apache.solr.request.SolrQueryRequest;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ValueSourceParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ValueSourceParser.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ValueSourceParser.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/ValueSourceParser.java Mon Jan  3 00:30:27 2011
@@ -614,7 +614,7 @@ class DateValueSourceParser extends Valu
   public ValueSource getValueSource(FunctionQParser fp, String arg) {
     if (arg == null) return null;
     SchemaField f = fp.req.getSchema().getField(arg);
-    if (f.getType().getClass() == DateField.class || f.getType().getClass() == LegacyDateField.class) {
+    if (f.getType().getClass() == DateField.class) {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Can't use ms() function on non-numeric legacy date field " + arg);
     }
     return f.getType().getValueSource(f, fp);

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ByteFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ByteFieldSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ByteFieldSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ByteFieldSource.java Mon Jan  3 00:30:27 2011
@@ -17,12 +17,8 @@ package org.apache.solr.search.function;
  */
 
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.search.cache.ByteValuesCreator;
-import org.apache.lucene.search.cache.LongValuesCreator;
 import org.apache.lucene.search.cache.CachedArray.ByteValues;
-import org.apache.lucene.search.cache.CachedArray.DoubleValues;
-import org.apache.lucene.search.cache.CachedArray.LongValues;
 
 import java.io.IOException;
 import java.util.Map;
@@ -86,4 +82,4 @@ public class ByteFieldSource extends Num
 
     };
   }
-}
\ No newline at end of file
+}

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ConstNumberSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ConstNumberSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ConstNumberSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ConstNumberSource.java Mon Jan  3 00:30:27 2011
@@ -17,11 +17,6 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
-
-import java.io.IOException;
-import java.util.Map;
-
 /**
  * <code>ConstNumberSource</code> is the base class for all constant numbers
  */

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DocFreqValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DocFreqValueSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DocFreqValueSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DocFreqValueSource.java Mon Jan  3 00:30:27 2011
@@ -23,7 +23,6 @@ import org.apache.lucene.search.Searcher
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.search.MutableValueInt;
 import org.apache.solr.search.MutableValue;
-import org.apache.solr.util.ByteUtils;
 
 import java.io.IOException;
 import java.util.Map;
@@ -242,9 +241,7 @@ public class DocFreqValueSource extends 
   @Override
   public DocValues getValues(Map context, IndexReader reader) throws IOException {
     Searcher searcher = (Searcher)context.get("searcher");
-    // todo: we need docFreq that takes a BytesRef
-    String strVal = ByteUtils.UTF8toUTF16(indexedBytes);
-    int docfreq = searcher.docFreq(new Term(indexedField, strVal));
+    int docfreq = searcher.docFreq(new Term(indexedField, indexedBytes));
     return new ConstIntDocValues(docfreq, this);
   }
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DoubleFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DoubleFieldSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DoubleFieldSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/DoubleFieldSource.java Mon Jan  3 00:30:27 2011
@@ -19,11 +19,8 @@ package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.util.Bits;
-import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.search.cache.DoubleValuesCreator;
-import org.apache.lucene.search.cache.FloatValuesCreator;
 import org.apache.lucene.search.cache.CachedArray.DoubleValues;
-import org.apache.lucene.search.cache.CachedArray.FloatValues;
 import org.apache.solr.search.MutableValue;
 import org.apache.solr.search.MutableValueDouble;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/FileFloatSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/FileFloatSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/FileFloatSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/FileFloatSource.java Mon Jan  3 00:30:27 2011
@@ -21,7 +21,6 @@ import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.util.StringHelper;
-import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.schema.SchemaField;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IDFValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IDFValueSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IDFValueSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IDFValueSource.java Mon Jan  3 00:30:27 2011
@@ -18,12 +18,9 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.*;
-import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Searcher;
 import org.apache.lucene.search.Similarity;
 import org.apache.lucene.util.BytesRef;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.search.SolrIndexReader;
 import org.apache.solr.util.ByteUtils;
 
 import java.io.IOException;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IntFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IntFieldSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IntFieldSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/IntFieldSource.java Mon Jan  3 00:30:27 2011
@@ -21,11 +21,7 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.util.Bits;
 import org.apache.solr.search.MutableValueInt;
 import org.apache.solr.search.MutableValue;
-import org.apache.lucene.search.FieldCache;
-import org.apache.lucene.search.cache.FloatValuesCreator;
 import org.apache.lucene.search.cache.IntValuesCreator;
-import org.apache.lucene.search.cache.CachedArray.DoubleValues;
-import org.apache.lucene.search.cache.CachedArray.FloatValues;
 import org.apache.lucene.search.cache.CachedArray.IntValues;
 
 import java.io.IOException;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/NormValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/NormValueSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/NormValueSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/NormValueSource.java Mon Jan  3 00:30:27 2011
@@ -20,8 +20,6 @@ package org.apache.solr.search.function;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.Searcher;
 import org.apache.lucene.search.Similarity;
-import org.apache.solr.search.SolrIndexReader;
-
 import java.io.IOException;
 import java.util.Map;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java Mon Jan  3 00:30:27 2011
@@ -20,7 +20,6 @@ package org.apache.solr.search.function;
 import org.apache.lucene.index.IndexReader;
 import org.apache.solr.search.MutableValue;
 import org.apache.solr.search.MutableValueInt;
-import org.apache.solr.util.NumberUtils;
 
 import java.io.IOException;
 import java.util.Map;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/PowFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/PowFloatFunction.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/PowFloatFunction.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/PowFloatFunction.java Mon Jan  3 00:30:27 2011
@@ -17,10 +17,6 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
-
-import java.io.IOException;
-
 /** Function to raise the base "a" to the power "b"
  */
 public class PowFloatFunction extends DualFloatFunction {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java Mon Jan  3 00:30:27 2011
@@ -16,11 +16,7 @@ package org.apache.solr.search.function;
  * limitations under the License.
  */
 
-import org.apache.lucene.search.FieldCache;
-import org.apache.lucene.search.cache.FloatValuesCreator;
 import org.apache.lucene.search.cache.ShortValuesCreator;
-import org.apache.lucene.search.cache.CachedArray.FloatValues;
-import org.apache.lucene.search.cache.CachedArray.LongValues;
 import org.apache.lucene.search.cache.CachedArray.ShortValues;
 import org.apache.lucene.index.IndexReader;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/SumFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/SumFloatFunction.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/SumFloatFunction.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/SumFloatFunction.java Mon Jan  3 00:30:27 2011
@@ -17,13 +17,6 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.Searcher;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Map;
-
 /**
  * <code>SumFloatFunction</code> returns the sum of it's components.
  */

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java Mon Jan  3 00:30:27 2011
@@ -19,8 +19,6 @@ package org.apache.solr.search.function;
 
 import org.apache.lucene.index.*;
 import org.apache.lucene.search.DocIdSetIterator;
-import org.apache.lucene.search.Searcher;
-import org.apache.lucene.search.Similarity;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.SolrException;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSource.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSource.java Mon Jan  3 00:30:27 2011
@@ -18,7 +18,6 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.FieldComparator;
 import org.apache.lucene.search.FieldComparatorSource;
 import org.apache.lucene.search.Scorer;
@@ -42,18 +41,11 @@ import java.util.Collections;
  */
 public abstract class ValueSource implements Serializable {
 
-  @Deprecated
-  public DocValues getValues(IndexReader reader) throws IOException {
-    return getValues(null, reader);
-  }
-
   /**
    * Gets the values for this reader and the context that was previously
    * passed to createWeight()
    */
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    return getValues(reader);
-  }
+  public abstract DocValues getValues(Map context, IndexReader reader) throws IOException;
 
   public abstract boolean equals(Object o);
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java Mon Jan  3 00:30:27 2011
@@ -17,7 +17,6 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.DocIdSet;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Searcher;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java Mon Jan  3 00:30:27 2011
@@ -21,7 +21,6 @@ import org.apache.lucene.search.spell.St
 import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SolrSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SolrSpellChecker.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SolrSpellChecker.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SolrSpellChecker.java Mon Jan  3 00:30:27 2011
@@ -17,14 +17,11 @@ package org.apache.solr.spelling;
  */
 
 import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.Token;
-import org.apache.lucene.index.IndexReader;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.search.SolrIndexSearcher;
 
 import java.io.IOException;
-import java.util.Collection;
 
 
 /**

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SpellCheckCollator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SpellCheckCollator.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SpellCheckCollator.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/spelling/SpellCheckCollator.java Mon Jan  3 00:30:27 2011
@@ -21,16 +21,13 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.apache.lucene.analysis.Token;
-import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.handler.component.QueryComponent;
 import org.apache.solr.handler.component.ResponseBuilder;
 import org.apache.solr.handler.component.SearchComponent;
-import org.apache.solr.handler.component.SearchHandler;
 import org.apache.solr.request.LocalSolrQueryRequest;
-import org.apache.solr.request.SolrQueryRequestBase;
 import org.apache.solr.response.SolrQueryResponse;
 import org.mortbay.log.Log;
 import org.slf4j.Logger;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/AddUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/AddUpdateCommand.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/AddUpdateCommand.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/AddUpdateCommand.java Mon Jan  3 00:30:27 2011
@@ -22,6 +22,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.index.Term;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.SolrInputField;
+import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.schema.SchemaField;
 
@@ -40,13 +41,14 @@ public class AddUpdateCommand extends Up
    // to index.
    public SolrInputDocument solrDoc;
 
-   public boolean allowDups;
-   public boolean overwritePending;
-   public boolean overwriteCommitted;
+   public boolean overwrite = true;
    
    public Term updateTerm;
    public int commitWithin = -1;
    
+   public AddUpdateCommand(SolrQueryRequest req) {
+     super("add", req);
+   }
 
    /** Reset state to reuse this object with a different document in the same request */
    public void clear() {
@@ -105,18 +107,12 @@ public class AddUpdateCommand extends Up
      return "(null)";
    }
 
-   public AddUpdateCommand() {
-     super("add");
-   }
-
    @Override
   public String toString() {
      StringBuilder sb = new StringBuilder(commandName);
      sb.append(':');
      if (indexedId !=null) sb.append("id=").append(indexedId);
-     sb.append(",allowDups=").append(allowDups);
-     sb.append(",overwritePending=").append(overwritePending);
-     sb.append(",overwriteCommitted=").append(overwriteCommitted);
+     if (!overwrite) sb.append(",overwrite=").append(overwrite);
      return sb.toString();
    }
  }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/CommitUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/CommitUpdateCommand.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/CommitUpdateCommand.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/CommitUpdateCommand.java Mon Jan  3 00:30:27 2011
@@ -16,6 +16,9 @@
  */
 
 package org.apache.solr.update;
+
+import org.apache.solr.request.SolrQueryRequest;
+
 /**
  * @version $Id$
  */
@@ -32,8 +35,8 @@ public class CommitUpdateCommand extends
    */
   public int maxOptimizeSegments = 1;
 
-  public CommitUpdateCommand(boolean optimize) {
-    super("commit");
+  public CommitUpdateCommand(SolrQueryRequest req, boolean optimize) {
+    super("commit", req);
     this.optimize=optimize;
   }
   public String toString() {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DeleteUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DeleteUpdateCommand.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DeleteUpdateCommand.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DeleteUpdateCommand.java Mon Jan  3 00:30:27 2011
@@ -16,17 +16,18 @@
  */
 
 package org.apache.solr.update;
+
+import org.apache.solr.request.SolrQueryRequest;
+
 /**
  * @version $Id$
  */
 public class DeleteUpdateCommand extends UpdateCommand {
   public String id;    // external (printable) id, for delete-by-id
   public String query; // query string for delete-by-query
-  public boolean fromPending;
-  public boolean fromCommitted;
 
-  public DeleteUpdateCommand() {
-    super("delete");
+  public DeleteUpdateCommand(SolrQueryRequest req) {
+    super("delete", req);
   }
 
   public String toString() {
@@ -34,8 +35,6 @@ public class DeleteUpdateCommand extends
     sb.append(':');
     if (id!=null) sb.append("id=").append(id);
     else sb.append("query=`").append(query).append('`');
-    sb.append(",fromPending=").append(fromPending);
-    sb.append(",fromCommitted=").append(fromCommitted);
     return sb.toString();
   }
 }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java Mon Jan  3 00:30:27 2011
@@ -20,9 +20,9 @@
 
 package org.apache.solr.update;
 
-import org.apache.lucene.index.CorruptIndexException;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Query;
@@ -44,6 +44,11 @@ import java.util.concurrent.atomic.Atomi
 import java.io.IOException;
 import java.net.URL;
 
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.request.LocalSolrQueryRequest;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.search.QParser;
 import org.apache.solr.search.QueryParsing;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.NamedList;
@@ -53,74 +58,7 @@ import org.apache.solr.core.SolrCore;
 /**
  * <code>DirectUpdateHandler2</code> implements an UpdateHandler where documents are added
  * directly to the main Lucene index as opposed to adding to a separate smaller index.
- * For this reason, not all combinations to/from pending and committed are supported.
- * This version supports efficient removal of duplicates on a commit.  It works by maintaining
- * a related count for every document being added or deleted.  At commit time, for every id with a count,
- * all but the last "count" docs with that id are deleted.
- * <p>
- *
- * Supported add command parameters:
- <TABLE BORDER>
-  <TR>
-    <TH>allowDups</TH>
-    <TH>overwritePending</TH>
-    <TH>overwriteCommitted</TH>
-    <TH>efficiency</TH>
-  </TR>
-  <TR>
-        <TD>false</TD>
-        <TD>false</TD>
-        <TD>true</TD>
-
-        <TD>fast</TD>
-  </TR>
-  <TR>
-        <TD>true or false</TD>
-        <TD>true</TD>
-        <TD>true</TD>
-
-        <TD>fast</TD>
-  </TR>
-  <TR>
-        <TD>true</TD>
-        <TD>false</TD>
-        <TD>false</TD>
-        <TD>fastest</TD>
-  </TR>
-
-</TABLE>
-
- <p>Supported delete commands:
- <TABLE BORDER>
-  <TR>
-    <TH>command</TH>
-    <TH>fromPending</TH>
-    <TH>fromCommitted</TH>
-    <TH>efficiency</TH>
-  </TR>
-  <TR>
-        <TD>delete</TD>
-        <TD>true</TD>
-        <TD>true</TD>
-        <TD>fast</TD>
-  </TR>
-  <TR>
-        <TD>deleteByQuery</TD>
-        <TD>true</TD>
-        <TD>true</TD>
-        <TD>very slow*</TD>
-  </TR>
-</TABLE>
-
-  <p>* deleteByQuery causes a commit to happen (close current index writer, open new index reader)
-  before it can be processed.  If deleteByQuery functionality is needed, it's best if they can
-  be batched and executed together so they may share the same index reader.
-
- *
- * @version $Id$
- * @since solr 0.9
  */
-
 public class DirectUpdateHandler2 extends UpdateHandler {
 
   // stats
@@ -201,11 +139,9 @@ public class DirectUpdateHandler2 extend
     addCommandsCumulative.incrementAndGet();
     int rc=-1;
 
-    // if there is no ID field, use allowDups
+    // if there is no ID field, don't overwrite
     if( idField == null ) {
-      cmd.allowDups = true;
-      cmd.overwriteCommitted = false;
-      cmd.overwritePending = false;
+      cmd.overwrite = false;
     }
 
     iwAccess.lock();
@@ -225,7 +161,7 @@ public class DirectUpdateHandler2 extend
       // should account for most of the time
 			Term updateTerm = null;
 
-      if (cmd.overwriteCommitted || cmd.overwritePending) {
+      if (cmd.overwrite) {
         if (cmd.indexedId == null) {
           cmd.indexedId = getIndexedId(cmd.doc);
         }
@@ -270,17 +206,6 @@ public class DirectUpdateHandler2 extend
     deleteByIdCommands.incrementAndGet();
     deleteByIdCommandsCumulative.incrementAndGet();
 
-    if (!cmd.fromPending && !cmd.fromCommitted) {
-      numErrors.incrementAndGet();
-      numErrorsCumulative.incrementAndGet();
-      throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"meaningless command: " + cmd);
-    }
-    if (!cmd.fromPending || !cmd.fromCommitted) {
-      numErrors.incrementAndGet();
-      numErrorsCumulative.incrementAndGet();
-      throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"operation not supported" + cmd);
-    }
-
     iwCommit.lock();
     try {
       openWriter();
@@ -296,44 +221,40 @@ public class DirectUpdateHandler2 extend
 
   // why not return number of docs deleted?
   // Depending on implementation, we may not be able to immediately determine the num...
-   public void deleteByQuery(DeleteUpdateCommand cmd) throws IOException {
-     deleteByQueryCommands.incrementAndGet();
-     deleteByQueryCommandsCumulative.incrementAndGet();
-
-     if (!cmd.fromPending && !cmd.fromCommitted) {
-       numErrors.incrementAndGet();
-       numErrorsCumulative.incrementAndGet();
-       throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"meaningless command: " + cmd);
-     }
-     if (!cmd.fromPending || !cmd.fromCommitted) {
-       numErrors.incrementAndGet();
-       numErrorsCumulative.incrementAndGet();
-       throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"operation not supported" + cmd);
-     }
+  public void deleteByQuery(DeleteUpdateCommand cmd) throws IOException {
+    deleteByQueryCommands.incrementAndGet();
+    deleteByQueryCommandsCumulative.incrementAndGet();
 
     boolean madeIt=false;
     boolean delAll=false;
     try {
-     Query q = QueryParsing.parseQuery(cmd.query, schema);
-     delAll = MatchAllDocsQuery.class == q.getClass();
+      Query q = null;
+      try {
+        QParser parser = QParser.getParser(cmd.query, "lucene", cmd.req);
+        q = parser.getQuery();
+      } catch (ParseException e) {
+        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
+      }
 
-     iwCommit.lock();
-     try {
-       if (delAll) {
-         deleteAll();
-       } else {
-        openWriter();
-        writer.deleteDocuments(q);
-       }
-     } finally {
-       iwCommit.unlock();
-     }
-
-     madeIt=true;
-
-     if( tracker.timeUpperBound > 0 ) {
-       tracker.scheduleCommitWithin( tracker.timeUpperBound );
-     }
+      delAll = MatchAllDocsQuery.class == q.getClass();
+
+      iwCommit.lock();
+      try {
+        if (delAll) {
+          deleteAll();
+        } else {
+          openWriter();
+          writer.deleteDocuments(q);
+        }
+      } finally {
+        iwCommit.unlock();
+      }
+
+      madeIt=true;
+
+      if( tracker.timeUpperBound > 0 ) {
+        tracker.scheduleCommitWithin( tracker.timeUpperBound );
+      }
     } finally {
       if (!madeIt) {
         numErrors.incrementAndGet();
@@ -594,8 +515,9 @@ public class DirectUpdateHandler2 extend
     /** This is the worker part for the ScheduledFuture **/
     public synchronized void run() {
       long started = System.currentTimeMillis();
+      SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams());
       try {
-        CommitUpdateCommand command = new CommitUpdateCommand( false );
+        CommitUpdateCommand command = new CommitUpdateCommand(req, false );
         command.waitFlush = true;
         command.waitSearcher = true;
         //no need for command.maxOptimizeSegments = 1;  since it is not optimizing
@@ -608,6 +530,7 @@ public class DirectUpdateHandler2 extend
       }
       finally {
         pending = null;
+        req.close();
       }
 
       // check if docs have been submitted since the commit started

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/MergeIndexesCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/MergeIndexesCommand.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/MergeIndexesCommand.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/MergeIndexesCommand.java Mon Jan  3 00:30:27 2011
@@ -18,6 +18,7 @@
 package org.apache.solr.update;
 
 import org.apache.lucene.store.Directory;
+import org.apache.solr.request.SolrQueryRequest;
 
 /**
  * A merge indexes command encapsulated in an object.
@@ -28,12 +29,12 @@ import org.apache.lucene.store.Directory
 public class MergeIndexesCommand extends UpdateCommand {
   public Directory[] dirs;
 
-  public MergeIndexesCommand() {
-    this(null);
+  public MergeIndexesCommand(SolrQueryRequest req) {
+    this(null, req);
   }
 
-  public MergeIndexesCommand(Directory[] dirs) {
-    super("mergeIndexes");
+  public MergeIndexesCommand(Directory[] dirs, SolrQueryRequest req) {
+    super("mergeIndexes", req);
     this.dirs = dirs;
   }
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/RollbackUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/RollbackUpdateCommand.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/RollbackUpdateCommand.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/RollbackUpdateCommand.java Mon Jan  3 00:30:27 2011
@@ -17,14 +17,16 @@
 
 package org.apache.solr.update;
 
+import org.apache.solr.request.SolrQueryRequest;
+
 /**
  * @version $Id$
  * @since Solr 1.4
  */
 public class RollbackUpdateCommand extends UpdateCommand {
 
-  public RollbackUpdateCommand() {
-    super("rollback");
+  public RollbackUpdateCommand(SolrQueryRequest req) {
+    super("rollback", req);
   }
 
 }

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/UpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/UpdateCommand.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/UpdateCommand.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/UpdateCommand.java Mon Jan  3 00:30:27 2011
@@ -17,15 +17,19 @@
 
 package org.apache.solr.update;
 
+import org.apache.solr.request.SolrQueryRequest;
+
 
 /** An index update command encapsulated in an object (Command pattern)
  *
  * @version $Id$
  */
   public class UpdateCommand {
-    protected String commandName;
+    protected final SolrQueryRequest req;
+    protected final String commandName;
 
-    public UpdateCommand(String commandName) {
+    public UpdateCommand(String commandName, SolrQueryRequest req) {
+      this.req = req;
       this.commandName = commandName;
     }
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/Lookup3Signature.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/Lookup3Signature.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/Lookup3Signature.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/Lookup3Signature.java Mon Jan  3 00:30:27 2011
@@ -16,12 +16,6 @@ package org.apache.solr.update.processor
  * limitations under the License.
  */
 
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.solr.common.util.Hash;
 
 public class Lookup3Signature extends Signature {

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java Mon Jan  3 00:30:27 2011
@@ -33,11 +33,7 @@ import org.apache.solr.common.util.StrUt
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.update.AddUpdateCommand;
-import org.apache.solr.update.CommitUpdateCommand;
-import org.apache.solr.update.DeleteUpdateCommand;
-import org.apache.solr.core.SolrResourceLoader;
 import org.apache.solr.core.SolrCore;
-import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.util.plugin.SolrCoreAware;
 

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/DateMathParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/DateMathParser.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/DateMathParser.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/DateMathParser.java Mon Jan  3 00:30:27 2011
@@ -17,7 +17,6 @@
 
 package org.apache.solr.util;
 
-import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.SolrRequestInfo;
 
 import java.util.Date;

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/SolrPluginUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/SolrPluginUtils.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/SolrPluginUtils.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/SolrPluginUtils.java Mon Jan  3 00:30:27 2011
@@ -33,6 +33,7 @@ import org.apache.solr.common.util.Named
 import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.core.SolrCore;
+import org.apache.solr.handler.component.HighlightComponent;
 import org.apache.solr.handler.component.ResponseBuilder;
 import org.apache.solr.highlight.SolrHighlighter;
 import org.apache.solr.request.SolrQueryRequest;
@@ -41,9 +42,6 @@ import org.apache.solr.schema.IndexSchem
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.search.*;
 import org.apache.solr.update.DocumentBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.io.IOException;
 import java.util.*;
 import java.util.regex.Pattern;
@@ -64,17 +62,6 @@ import java.lang.reflect.InvocationTarge
  * default parameter settings.
  */
 public class SolrPluginUtils {
-  final static Logger log = LoggerFactory.getLogger( SolrPluginUtils.class );
-
-  /**
-   * Set defaults on a SolrQueryRequest.
-   *
-   * RequestHandlers can use this method to ensure their defaults are
-   * visible to other components such as the response writer
-   */
-  public static void setDefaults(SolrQueryRequest req, SolrParams defaults) {
-    setDefaults(req, defaults, null, null);
-  }
 
   /**
    * Set default-ish params on a SolrQueryRequest.
@@ -104,13 +91,6 @@ public class SolrPluginUtils {
   }
 
 
-  /**
-   * standard param for field list
-   *
-   * @deprecated Use org.apache.solr.common.params.CommonParams.FL.
-   */
-  @Deprecated
-  public static String FL = CommonParams.FL;
 
   /**
    * SolrIndexSearch.numDocs(Query,Query) freaks out if the filtering
@@ -123,59 +103,10 @@ public class SolrPluginUtils {
 
   }
 
-  /**
-   * Returns the param, or the default if it's empty or not specified.
-   * @deprecated use SolrParam.get(String,String)
-   */
-  @Deprecated
-  public static String getParam(SolrQueryRequest req,
-                                String param, String def) {
 
-    String v = req.getParam(param);
-    // Note: parameters passed but given only white-space value are
-    // considered equivalent to passing nothing for that parameter.
-    if (null == v || "".equals(v.trim())) {
-      return def;
-    }
-    return v;
-  }
 
-  /**
-   * Treats the param value as a Number, returns the default if nothing is
-   * there or if it's not a number.
-   * @deprecated use SolrParam.getFloat(String,float)
-   */
-  @Deprecated
-  public static Number getNumberParam(SolrQueryRequest req,
-                                      String param, Number def) {
 
-    Number r = def;
-    String v = req.getParam(param);
-    if (null == v || "".equals(v.trim())) {
-      return r;
-    }
-    try {
-      r = new Float(v);
-    } catch (NumberFormatException e) {
-      /* :NOOP" */
-    }
-    return r;
-  }
 
-  /**
-   * Treats parameter value as a boolean.  The string 'false' is false;
-   * any other non-empty string is true.
-   * @deprecated use SolrParam.getBool(String,boolean)
-   */
-  @Deprecated
-  public static boolean getBooleanParam(SolrQueryRequest req,
-                                       String param, boolean def) {
-    String v = req.getParam(param);
-    if (null == v || "".equals(v.trim())) {
-      return def;
-    }
-    return !"false".equals(v.trim());
-  }
 
   private final static Pattern splitList=Pattern.compile(",| ");
 
@@ -238,7 +169,8 @@ public class SolrPluginUtils {
    *
    * If lazy field loading is disabled, this method does nothing.
    */
-  public static void optimizePreFetchDocs(DocList docs,
+  public static void optimizePreFetchDocs(ResponseBuilder rb,
+                                          DocList docs,
                                           Query query,
                                           SolrQueryRequest req,
                                           SolrQueryResponse res) throws IOException {
@@ -248,28 +180,34 @@ public class SolrPluginUtils {
       return;
     }
 
-    Set<String> fieldFilter = null;
     Set<String> returnFields = res.getReturnFields();
+    Set<String> fieldFilter = returnFields;
+
     if(returnFields != null) {
-      // copy return fields list
-      fieldFilter = new HashSet<String>(returnFields);
-      // add highlight fields
-      SolrHighlighter highligher = req.getCore().getHighlighter();
-      if(highligher.isHighlightingEnabled(req.getParams())) {
-        for(String field: highligher.getHighlightFields(query, req, null))
+
+      if (rb.doHighlights) {
+        // copy return fields list
+        fieldFilter = new HashSet<String>(returnFields);
+        // add highlight fields
+
+        SolrHighlighter highlighter = HighlightComponent.getHighlighter(req.getCore());
+        for (String field: highlighter.getHighlightFields(query, req, null))
           fieldFilter.add(field);
-      }
-      // fetch unique key if one exists.
-      SchemaField keyField = req.getSearcher().getSchema().getUniqueKeyField();
-      if(null != keyField)
+
+        // fetch unique key if one exists.
+        SchemaField keyField = req.getSearcher().getSchema().getUniqueKeyField();
+        if(null != keyField)
           fieldFilter.add(keyField.getName());
-    }
+      }
+
+      // get documents
+      DocIterator iter = docs.iterator();
+      for (int i=0; i<docs.size(); i++) {
+        searcher.doc(iter.nextDoc(), fieldFilter);
+      }
 
-    // get documents
-    DocIterator iter = docs.iterator();
-    for (int i=0; i<docs.size(); i++) {
-      searcher.doc(iter.nextDoc(), fieldFilter);
     }
+
   }
 
 
@@ -451,23 +389,6 @@ public class SolrPluginUtils {
     return out;
   }
 
-  /**
-   * Generates an list of Explanations for each item in a list of docs.
-   *
-   * @param query The Query you want explanations in the context of
-   * @param docs The Documents you want explained relative that query
-   * @deprecated this returns the explanations as Strings, instead it
-   *    is recommeded to use getExplanations and call toString()
-   *    yourself, or use explanationsToNamedLists
-   */
-  @Deprecated
-  public static NamedList getExplainList(Query query, DocList docs,
-                                         SolrIndexSearcher searcher,
-                                         IndexSchema schema)
-    throws IOException {
-
-    return explanationsToStrings(getExplanations(query,docs,searcher,schema));
-  }
 
   /**
    * Executes a basic query
@@ -536,33 +457,6 @@ public class SolrPluginUtils {
     }
     return out;
   }
-  /**
-   * Given a string containing functions with optional boosts, returns
-   * an array of Queries representing those functions with the specified
-   * boosts.
-   * <p>
-   * NOTE: intra-function whitespace is not allowed.
-   * </p>
-   * @see #parseFieldBoosts
-   * @deprecated
-   */
-  @Deprecated
-  public static List<Query> parseFuncs(IndexSchema s, String in)
-    throws ParseException {
-
-    Map<String,Float> ff = parseFieldBoosts(in);
-    List<Query> funcs = new ArrayList<Query>(ff.keySet().size());
-    for (String f : ff.keySet()) {
-      Query fq = QueryParsing.parseFunction(f, s);
-      Float b = ff.get(f);
-      if (null != b) {
-        fq.setBoost(b);
-      }
-      funcs.add(fq);
-    }
-    return funcs;
-  }
-
 
   /**
    * Checks the number of optional clauses in the query, and compares it
@@ -781,14 +675,6 @@ public class SolrPluginUtils {
       // don't trust that our parent class won't ever change it's default
       setDefaultOperator(QueryParser.Operator.OR);
     }
-    public DisjunctionMaxQueryParser(IndexSchema s, String defaultField) {
-      super(s,defaultField);
-      // don't trust that our parent class won't ever change it's default
-      setDefaultOperator(QueryParser.Operator.OR);
-    }
-    public DisjunctionMaxQueryParser(IndexSchema s) {
-      this(s,null);
-    }
 
     /**
      * Add an alias to this query parser.
@@ -885,15 +771,6 @@ public class SolrPluginUtils {
     return ss;
   }
 
-  /**
-   * Builds a list of Query objects that should be used to filter results
-   * @see CommonParams#FQ
-   * @return null if no filter queries
-   */
-  public static List<Query> parseFilterQueries(SolrQueryRequest req) throws ParseException {
-    return parseQueryStrings(req, req.getParams().getParams(CommonParams.FQ));
-  }
-
   /** Turns an array of query strings into a List of Query objects.
    *
    * @return null if no queries are generated
@@ -984,27 +861,6 @@ public class SolrPluginUtils {
   }
 
 
-
-  /**
-   * Given a SolrQueryResponse replace the DocList if it is in the result.
-   * Otherwise add it to the response
-   *
-   * @since solr 1.4
-   */
-  public static void addOrReplaceResults(SolrQueryResponse rsp, SolrDocumentList docs)
-  {
-    NamedList vals = rsp.getValues();
-    int idx = vals.indexOf( "response", 0 );
-    if( idx >= 0 ) {
-      log.debug("Replacing DocList with SolrDocumentList " + docs.size());
-      vals.setVal( idx, docs );
-    }
-    else {
-      log.debug("Adding SolrDocumentList response" + docs.size());
-      vals.add( "response", docs );
-    }
-  }
-
   public static void invokeSetters(Object bean, NamedList initArgs) {
     if (initArgs == null) return;
     Class clazz = bean.getClass();

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/TestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/TestHarness.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/TestHarness.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/TestHarness.java Mon Jan  3 00:30:27 2011
@@ -17,6 +17,7 @@
 
 package org.apache.solr.util;
 
+import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.XML;
@@ -25,20 +26,22 @@ import org.apache.solr.core.SolrCore;
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.CoreDescriptor;
 import org.apache.solr.core.SolrResourceLoader;
+import org.apache.solr.handler.JsonUpdateRequestHandler;
 import org.apache.solr.handler.XmlUpdateRequestHandler;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.request.SolrRequestHandler;
 import org.apache.solr.request.SolrRequestInfo;
 import org.apache.solr.response.QueryResponseWriter;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.schema.IndexSchema;
+import org.apache.solr.servlet.DirectSolrConnection;
 import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
 import org.apache.solr.common.util.NamedList.NamedListEntry;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpressionException;
@@ -49,10 +52,7 @@ import java.io.IOException;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 
@@ -206,20 +206,25 @@ public class TestHarness {
   /**
    * Processes an "update" (add, commit or optimize) and
    * returns the response as a String.
-   * 
-   * @deprecated The better approach is to instantiate an Updatehandler directly
    *
    * @param xml The XML of the update
    * @return The XML response to the update
    */
-  @Deprecated
   public String update(String xml) {
-                
-    StringReader req = new StringReader(xml);
-    StringWriter writer = new StringWriter(32000);
-
-    updater.doLegacyUpdate(req, writer);
-    return writer.toString();
+    DirectSolrConnection connection = new DirectSolrConnection(core);
+    SolrRequestHandler handler = core.getRequestHandler("/update");
+    // prefer the handler mapped to /update, but use our generic backup handler
+    // if that lookup fails
+    if (handler == null) {
+      handler = updater;
+    }
+    try {
+      return connection.request(handler, null, xml);
+    } catch (SolrException e) {
+      throw (SolrException)e;
+    } catch (Exception e) {
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
+    }
   }
   
         
@@ -244,7 +249,12 @@ public class TestHarness {
    * @return null if successful, otherwise the XML response to the update
    */
   public String validateErrorUpdate(String xml) throws SAXException {
-    return checkUpdateStatus(xml, "1");
+    try {
+      return checkUpdateStatus(xml, "1");
+    } catch (SolrException e) {
+      // return ((SolrException)e).getMessage();
+      return null;  // success
+    }
   }
 
   /**
@@ -258,7 +268,7 @@ public class TestHarness {
   public String checkUpdateStatus(String xml, String code) throws SAXException {
     try {
       String res = update(xml);
-      String valid = validateXPath(res, "//result[@status="+code+"]" );
+      String valid = validateXPath(res, "//int[@name='status']="+code );
       return (null == valid) ? null : res;
     } catch (XPathExpressionException e) {
       throw new RuntimeException
@@ -266,27 +276,6 @@ public class TestHarness {
     }
   }
 
-  /**
-   * Validates that an add of a single document results in success.
-   *
-   * @param fieldsAndValues Odds are field names, Evens are values
-   * @return null if successful, otherwise the XML response to the update
-   * @see #appendSimpleDoc
-   */
-  public String validateAddDoc(String... fieldsAndValues)
-    throws XPathExpressionException, SAXException, IOException {
-
-    StringBuilder buf = new StringBuilder();
-    buf.append("<add>");
-    appendSimpleDoc(buf, fieldsAndValues);
-    buf.append("</add>");
-        
-    String res = update(buf.toString());
-    String valid = validateXPath(res, "//result[@status=0]" );
-    return (null == valid) ? null : res;
-  }
-
-
     
   /**
    * Validates a "query" response against an array of XPath test strings
@@ -414,29 +403,6 @@ public class TestHarness {
   }
 
   /**
-   * A helper that adds an xml &lt;doc&gt; containing all of the
-   * fields and values specified (odds are fields, evens are values)
-   * to a StringBuilder
-   */
-  public void appendSimpleDoc(StringBuilder buf, String... fieldsAndValues)
-    throws IOException {
-
-    buf.append(makeSimpleDoc(fieldsAndValues));
-  }
-
-  /**
-   * A helper that adds an xml &lt;doc&gt; containing all of the
-   * fields and values specified (odds are fields, evens are values)
-   * to a StringBuffer.
-   * @deprecated see {@link #appendSimpleDoc(StringBuilder, String...)}
-   */
-  @Deprecated
-  public void appendSimpleDoc(StringBuffer buf, String... fieldsAndValues)
-    throws IOException {
-
-    buf.append(makeSimpleDoc(fieldsAndValues));
-  }
-  /**
    * A helper that creates an xml &lt;doc&gt; containing all of the
    * fields and values specified
    *

Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/plugin/AbstractPluginLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/plugin/AbstractPluginLoader.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/plugin/AbstractPluginLoader.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/util/plugin/AbstractPluginLoader.java Mon Jan  3 00:30:27 2011
@@ -27,7 +27,6 @@ import org.apache.solr.common.SolrExcept
 import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.util.DOMUtil;
 import org.apache.solr.core.SolrConfig;
-import org.apache.solr.core.SolrResourceLoader;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 

Modified: lucene/dev/branches/realtime_search/solr/src/maven/solr-core-pom.xml.template
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/maven/solr-core-pom.xml.template?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/maven/solr-core-pom.xml.template (original)
+++ lucene/dev/branches/realtime_search/solr/src/maven/solr-core-pom.xml.template Mon Jan  3 00:30:27 2011
@@ -91,6 +91,13 @@
       <artifactId>lucene-spellchecker</artifactId>
       <version>@version@</version>
     </dependency>
+    
+    <!-- Apache Zookeeper -->
+    <dependency>
+      <groupId>org.apache.zookeeper</groupId>
+      <artifactId>zookeeper</artifactId>
+      <version>3.3.1</version>
+    </dependency>
 
     <!-- Apache Commons -->
     <dependency>

Modified: lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java Mon Jan  3 00:30:27 2011
@@ -18,7 +18,6 @@ package org.apache.solr.client.solrj.imp
 
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.DefaultMethodRetryHandler;
 import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
 import org.apache.commons.httpclient.params.HttpMethodParams;
 import org.apache.solr.client.solrj.*;
@@ -32,7 +31,6 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.locks.ReentrantLock;
 import java.util.*;
 
 /**

Modified: lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/ContentStreamUpdateRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/ContentStreamUpdateRequest.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/ContentStreamUpdateRequest.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/ContentStreamUpdateRequest.java Mon Jan  3 00:30:27 2011
@@ -17,12 +17,6 @@ package org.apache.solr.client.solrj.req
  */
 
 
-import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.SolrServer;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.response.UpdateResponse;
-import org.apache.solr.common.params.ModifiableSolrParams;
-import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.common.util.ContentStreamBase;
 

Modified: lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/FieldAnalysisRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/FieldAnalysisRequest.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/FieldAnalysisRequest.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/FieldAnalysisRequest.java Mon Jan  3 00:30:27 2011
@@ -96,8 +96,8 @@ public class FieldAnalysisRequest extend
    */
   @Override
   public FieldAnalysisResponse process(SolrServer server) throws SolrServerException, IOException {
-    if (fieldTypes == null || fieldNames == null) {
-      throw new IllegalStateException("A list one field type or field name need to be specified");
+    if (fieldTypes == null && fieldNames == null) {
+      throw new IllegalStateException("At least one field type or field name need to be specified");
     }
     if (fieldValue == null) {
       throw new IllegalStateException("The field value must be set");

Modified: lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java Mon Jan  3 00:30:27 2011
@@ -25,10 +25,6 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Iterator;
 
-import org.apache.solr.client.solrj.SolrServer;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.response.UpdateResponse;
 import org.apache.solr.client.solrj.util.ClientUtils;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.ModifiableSolrParams;

Modified: lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/response/PivotField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/response/PivotField.java?rev=1054507&r1=1054506&r2=1054507&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/response/PivotField.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/solrj/org/apache/solr/client/solrj/response/PivotField.java Mon Jan  3 00:30:27 2011
@@ -18,7 +18,6 @@
 package org.apache.solr.client.solrj.response;
 
 import java.io.PrintStream;
-import java.io.PrintWriter;
 import java.io.Serializable;
 import java.util.List;
 



Mime
View raw message