Is it generally recognized that this terminology is confusing, or is it just me?
I do understand what they do (at least well enough to use them), but I find it confusing that it's called "defType" as a main param, but "type" in a LocalParam, when to me they both seem to do the same thing -- which I think should probably be called 'queryParser' rather than 'type' or 'defType'. That's what they do, choose the query parser for the query they apply to, right? (And if they did/do different things, 'defType' vs 'type' doesn't really provide much hint as to what!) These are both the same, right, but with different param names depending on position: &defType=lucene&q=foo &q={!type=lucene}foo # uri escaping not shown (and then there's 'qt', often confused with defType/type by newbies, since they guess it stands for 'query type', but which should probably actually have been called 'requestHandler'/'rh' instead, since that's what it actually chooses, no? It gets very confusing). If it's generally recognized it's confusing and perhaps a somewhat inconsistent mental model being implied, I wonder if there'd be any interest in renaming these to be more clear, leaving the old ones as aliases/synonyms for backwards compatibility (perhaps with a long deprecation period, or perhaps existing forever). I know it was very confusing to me to keep track of these parameters and what they did for quite a while, and still trips me up from time to time. Jonathan ________________________________________ From: ysee...@gmail.com [ysee...@gmail.com] on behalf of Yonik Seeley [yo...@lucidimagination.com] Sent: Tuesday, July 19, 2011 9:40 PM To: solr-user@lucene.apache.org Subject: Re: defType argument weirdness On Tue, Jul 19, 2011 at 1:25 PM, Naomi Dushay <ndus...@stanford.edu> wrote: > Regardless, I thought that defType=dismax&q=*:* is supposed to be > equivalent to q={!defType=dismax}*:* and also equivalent to q={!dismax}*:* Not quite - there is a very subtle distinction. {!dismax} is short for {!type=dismax}, the type of the actual query, and this may not be overridden. The defType local param is only the default type for sub-queries (as opposed to the current query). It's useful in conjunction with the "query" or nested query qparser: http://lucene.apache.org/solr/api/org/apache/solr/search/NestedQParserPlugin.html -Yonik http://www.lucidimagination.com