Array of arguments in URL?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Array of arguments in URL?

Lance Norskog-2
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
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Array of arguments in URL?

Grant Ingersoll-2
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
> [hidden email]


Reply | Threaded
Open this post in threaded view
|

RE: Array of arguments in URL?

Jonathan Rochkind-2
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 [[hidden email]] On Behalf Of Grant Ingersoll [[hidden email]]
Sent: Wednesday, June 02, 2010 6:28 AM
To: [hidden email]
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
> [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Array of arguments in URL?

Chris Hostetter-3
In reply to this post by Lance Norskog-2

: 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

Reply | Threaded
Open this post in threaded view
|

Re: Array of arguments in URL?

Lance Norskog-2
Ah! Thank you.

On Wed, Jun 2, 2010 at 9:52 AM, Chris Hostetter
<[hidden email]> 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
[hidden email]