Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by YonikSeeley: http://wiki.apache.org/solr/LocalParams ------------------------------------------------------------------------------ {{{q={!q.op=AND df=title}solr rocks }}} - === Syntax === + === Basic Syntax === - An argument with localparams starts with {{{ {! }}} and the localparams end with {{{ } }}} followed by the original argument value. There may only be one localparams prefix per argument, preventing the need for any escaping of the original argument. Name value pairs in localparams are separated by whitespace. Values may be quoted via single or double quotes, and backslash escaping works only in quoted strings. + An argument with localparams starts with {{{ {! }}}, includes any number of {{{key=value}}} pairs separated by whitespace, and the localparams end with {{{ } }}} followed by the original argument value. There may only be one localparams prefix per argument, preventing the need for any escaping of the original argument. Values in the key-value pairs may be quoted via single or double quotes, and backslash escaping works within quoted strings. + === 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 - {{{q={!dismax}solr rocks + {{{q={!dismax qf=myfield}solr rocks }}} is equivalent to - {{{q={!type=dismax}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 + }}} is equivalent to + {{{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 ne 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 + }}} is equivalent to + {{{q={!type=dismax qf=myfield v=$qq}&qq=solr rocks + }}} - - LocalParams parameter dereferencing can effectively be used to decouple user input from query parameters, or front-end GUI from defaults set in solrconfig.xml. -
