On Wed, Sep 23, 2009 at 5:54 PM, Apache Wiki <[email protected]> wrote:
> + `q={!type=dismax qf=myfield yourfield}solr rocks`
> + will give an error because "yourfield" is expected to be a key=value pair.
This doesn't give an error for the reason you think it does :-)
A single word like this is shorthand for type=yourfield... so
q={!type=dismax qf=myfield lucene}solr rocks
would not throw an error and parse to a lucene query.
This shorthand notation is what allows
{!dismax} to mean the same thing as {!type=dismax}
It's undocumented that it actually works if it's not the first
param... perhaps we should limit that in the future.
> + example of backslash escaping:
> + `q={!type=dismax qf="title"}2 \+ 2`
This isn't an example of local params backslash escaping.
There is no escaping at all in the value (that's considered a feature).
-Yonik
http://www.lucidimagination.com
> === Query type short-form ===
> - If a localparam value appears without a name, it is given the implicit name
> of "type". This allows short-form representation for the type of query
> parser to use when parsing a query string. Thus
> + If a LocalParams value appears without a name, it is given the implicit
> name of "type". This allows short-form representation for the type of query
> parser to use when parsing a query string. Thus
> - {{{q={!dismax qf=myfield}solr rocks
> + `q={!dismax qf=myfield}solr rocks`
> - }}} is equivalent to
> + is equivalent to
> - {{{q={!type=dismax qf=myfield}solr rocks
> + `q={!type=dismax qf=myfield}solr rocks`
> - }}}
>
> === Parameter value ===
> A special key of "v" within local parameters is an alternate way to specify
> the value of that parameter.
> - {{{q={!dismax qf=myfield}solr rocks
> + `q={!dismax qf=myfield}solr rocks`
> - }}} is equivalent to
> + is equivalent to
> - {{{q={!type=dismax qf=myfield v='solr rocks'}
> + `q={!type=dismax qf=myfield v='solr rocks'}`
> - }}}
>
> === Parameter dereferencing ===
> Parameter dereferencing or indirection allows one to use the value of
> another argument rather than specifying it directly. This can be used to
> simplify queries, decouple user input from query parameters, or decouple
> front-end GUI parameters from defaults set in solrconfig.xml.
> - {{{q={!dismax qf=myfield}solr rocks
> + `q={!dismax qf=myfield}solr rocks`
> - }}} is equivalent to
> + is equivalent to
> - {{{q={!type=dismax qf=myfield v=$qq}&qq=solr rocks
> + `q={!type=dismax qf=myfield v=$qq}&qq=solr rocks`
> - }}}
>
>