Skip to content

Apache Lucene open-source search software

SOLR-3313 Rename Query Type to Query Parser

David Wayne Smiley991bbd7b5749
diff --git a/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml b/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml
index 44728523d17..76cd7d4756c 100644
--- a/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml
+++ b/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml
@@ -305,7 +305,7 @@
<!-- DisMaxRequestHandler allows easy searching across multiple fields
for simple user-entered phrases. It's implementation is now
- just the standard SearchHandler with a default query type
+ just the standard SearchHandler with a default query parser
of "dismax".
see http://wiki.apache.org/solr/DisMaxRequestHandler
-->
diff --git a/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml b/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml
index 3419b01f6b2..0444bf8f7b1 100644
--- a/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml
+++ b/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml
@@ -400,7 +400,7 @@
<!--
DisMaxRequestHandler allows easy searching across multiple fields
for simple user-entered phrases. It's implementation is now just the
- standard SearchHandler with a default query type of "dismax". see
+ standard SearchHandler with a default query parser of "dismax". see
http://wiki.apache.org/solr/DisMaxRequestHandler
-->
<requestHandler name="dismax" class="solr.SearchHandler">
diff --git a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
index 65edfd095c3..40cacc3b70f 100644
--- a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
+++ b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
@@ -400,7 +400,7 @@
<!--
DisMaxRequestHandler allows easy searching across multiple fields
for simple user-entered phrases. It's implementation is now just the
- standard SearchHandler with a default query type of "dismax". see
+ standard SearchHandler with a default query parser of "dismax". see
http://wiki.apache.org/solr/DisMaxRequestHandler
-->
<requestHandler name="dismax" class="solr.SearchHandler">
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 601f1b33e63..a5d25568eab 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -1753,7 +1753,7 @@ public final class SolrCore implements SolrInfoMBean {
public QParserPlugin getQueryPlugin(String parserName) {
QParserPlugin plugin = qParserPlugins.get(parserName);
if (plugin != null) return plugin;
- throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Unknown query type '"+parserName+"'");
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Unknown query parser '"+parserName+"'");
}
private final HashMap<String, ValueSourceParser> valueSourceParsers = new HashMap<String, ValueSourceParser>();
diff --git a/solr/core/src/java/org/apache/solr/search/QParser.java b/solr/core/src/java/org/apache/solr/search/QParser.java
index 108be54844b..b5cf1ec6176 100755
--- a/solr/core/src/java/org/apache/solr/search/QParser.java
+++ b/solr/core/src/java/org/apache/solr/search/QParser.java
@@ -300,15 +300,15 @@ public abstract class QParser {
}
/** Create a <code>QParser</code> to parse <code>qstr</code>,
- * assuming that the default query type is <code>defaultType</code>.
- * The query type may be overridden by local parameters in the query
- * string itself. For example if defaultType=<code>"dismax"</code>
+ * assuming that the default query parser is <code>defaultParser</code>.
+ * The query parser may be overridden by local parameters in the query
+ * string itself. For example if defaultParser=<code>"dismax"</code>
* and qstr=<code>foo</code>, then the dismax query parser will be used
* to parse and construct the query object. However
* if qstr=<code>{!prefix f=myfield}foo</code>
* then the prefix query parser will be used.
*/
- public static QParser getParser(String qstr, String defaultType, SolrQueryRequest req) throws ParseException {
+ public static QParser getParser(String qstr, String defaultParser, SolrQueryRequest req) throws ParseException {
// SolrParams localParams = QueryParsing.getLocalParams(qstr, req.getParams());
String stringIncludingLocalParams = qstr;
@@ -335,18 +335,18 @@ public abstract class QParser {
}
- String type;
+ String parserName;
if (localParams == null) {
- type = defaultType;
+ parserName = defaultParser;
} else {
- type = localParams.get(QueryParsing.TYPE,defaultType);
+ parserName = localParams.get(QueryParsing.TYPE,defaultParser);
qstr = localParams.get("v");
}
- type = type==null ? QParserPlugin.DEFAULT_QTYPE : type;
+ parserName = parserName==null ? QParserPlugin.DEFAULT_QTYPE : parserName;
- QParserPlugin qplug = req.getCore().getQueryPlugin(type);
+ QParserPlugin qplug = req.getCore().getQueryPlugin(parserName);
QParser parser = qplug.createParser(qstr, localParams, req.getParams(), req);
parser.stringIncludingLocalParams = stringIncludingLocalParams;
diff --git a/solr/core/src/java/org/apache/solr/search/QueryParsing.java b/solr/core/src/java/org/apache/solr/search/QueryParsing.java
index 5afb10aee3d..edfbae93404 100644
--- a/solr/core/src/java/org/apache/solr/search/QueryParsing.java
+++ b/solr/core/src/java/org/apache/solr/search/QueryParsing.java
@@ -58,8 +58,8 @@ public class QueryParsing {
public static final String OP = "q.op"; // the SolrParam used to override the QueryParser "default operator"
public static final String V = "v"; // value of this parameter
public static final String F = "f"; // field that a query or command pertains to
- public static final String TYPE = "type";// type of this query or command
- public static final String DEFTYPE = "defType"; // default type for any direct subqueries
+ public static final String TYPE = "type";// parser for this query or command
+ public static final String DEFTYPE = "defType"; // default parser for any direct subqueries
public static final String LOCALPARAM_START = "{!";
public static final char LOCALPARAM_END = '}';
public static final String DOCID = "_docid_";
diff --git a/solr/example/example-DIH/solr/mail/conf/solrconfig.xml b/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
index 2436f138015..aa1df770aba 100644
--- a/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
+++ b/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
@@ -324,7 +324,7 @@
<!-- DisMaxRequestHandler allows easy searching across multiple fields
for simple user-entered phrases. It's implementation is now
- just the standard SearchHandler with a default query type
+ just the standard SearchHandler with a default query parser
of "dismax".
see http://wiki.apache.org/solr/DisMaxRequestHandler
-->