SOLR-3313 Rename Query Type to Query Parser

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1352760 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Wayne Smiley 2012-06-22 02:41:36 +00:00
parent 59313cd115
commit 991bbd7b57
7 changed files with 16 additions and 16 deletions

View File

@ -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
-->

View File

@ -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">

View File

@ -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">

View File

@ -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>();

View File

@ -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;

View File

@ -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_";

View File

@ -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
-->