You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Lance Norskog <go...@gmail.com> on 2010/06/02 03:00:06 UTC

Array of arguments in URL?

In the "/spell" declaration in the example solrconfig.xml, we find
these lines among the default parameters:

    <arr name="last-components">
      <str>spellcheck</str>
    </arr>

How does one supply such an array of strings in HTTP parameters? Does
Solr have a parsing option for this?

-- 
Lance Norskog
goksron@gmail.com

Re: Array of arguments in URL?

Posted by Lance Norskog <go...@gmail.com>.
Ah! Thank you.

On Wed, Jun 2, 2010 at 9:52 AM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : In the "/spell" declaration in the example solrconfig.xml, we find
> : these lines among the default parameters:
>
> as grant pointed out: these aren't in the default params
>
> : How does one supply such an array of strings in HTTP parameters? Does
> : Solr have a parsing option for this?
>
> in general, ignoring for a moment hte question of wether you are asking
> about changing the component list in a param (you can't) and addressing
> just the question of specifing an array of strings in HTTP params: if the
> param supports multiple values, then you can specify multiple values just
> be  repeating hte key...
>
>  q=foo&fq=firstValue&fq=secondValue&fq=thirdValue
>
> ...this results in a SolrParams instance where the "value" of "fq" is an
> array of [firstValue, secondValue]
>
>
>
>
> -Hoss
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Array of arguments in URL?

Posted by Chris Hostetter <ho...@fucit.org>.
: In the "/spell" declaration in the example solrconfig.xml, we find
: these lines among the default parameters:

as grant pointed out: these aren't in the default params

: How does one supply such an array of strings in HTTP parameters? Does
: Solr have a parsing option for this?

in general, ignoring for a moment hte question of wether you are asking 
about changing the component list in a param (you can't) and addressing 
just the question of specifing an array of strings in HTTP params: if the 
param supports multiple values, then you can specify multiple values just 
be  repeating hte key...

  q=foo&fq=firstValue&fq=secondValue&fq=thirdValue

...this results in a SolrParams instance where the "value" of "fq" is an 
array of [firstValue, secondValue] 




-Hoss


RE: Array of arguments in URL?

Posted by Jonathan Rochkind <ro...@jhu.edu>.
You CAN easily turn spellchecking on or off, or set the spellcheck dictionary, in request parameters.  So there's really no need, that I can think of,  to try to actually add or remove the spellcheck component in request parameters; you could just leave it turned off in your default parameters, but turn it on in request parameters when you want it.  With &spellcheck=true&spellcheck.dictionary=whatever. 

But I suspect you weren't really asking about spellcheck component, but in general, or perhaps for some other specific purpose? I don't think there's any "general" way to pass an array to request parameters. Request parameters that take list-like data structures tend to use whitespace to seperate the elements instead, to allow you to pass them as request parameters. For instance dismax df, pf, etc fields, elements ordinarily seperated by newlines when seen in a solrconfig.xml as default params, can also be seperated simply by spaces in an actual URL too. (newlines in the URL might work too, never tried it, spaces more convenient for an actual URL). 
________________________________________
From: Grant Ingersoll [gsiasf@gmail.com] On Behalf Of Grant Ingersoll [gsingers@apache.org]
Sent: Wednesday, June 02, 2010 6:28 AM
To: solr-user@lucene.apache.org
Subject: Re: Array of arguments in URL?

Those aren't in the default parameters.  They are config for the SearchHandler itself.

On Jun 1, 2010, at 9:00 PM, Lance Norskog wrote:

> In the "/spell" declaration in the example solrconfig.xml, we find
> these lines among the default parameters:
>
>    <arr name="last-components">
>      <str>spellcheck</str>
>    </arr>
>
> How does one supply such an array of strings in HTTP parameters? Does
> Solr have a parsing option for this?
>
> --
> Lance Norskog
> goksron@gmail.com



Re: Array of arguments in URL?

Posted by Grant Ingersoll <gs...@apache.org>.
Those aren't in the default parameters.  They are config for the SearchHandler itself.

On Jun 1, 2010, at 9:00 PM, Lance Norskog wrote:

> In the "/spell" declaration in the example solrconfig.xml, we find
> these lines among the default parameters:
> 
>    <arr name="last-components">
>      <str>spellcheck</str>
>    </arr>
> 
> How does one supply such an array of strings in HTTP parameters? Does
> Solr have a parsing option for this?
> 
> -- 
> Lance Norskog
> goksron@gmail.com