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 Ryan McKinley <ry...@gmail.com> on 2008/07/16 02:56:45 UTC
spellchecking multiple fields?
I have a use case where I want to spellcheck the input query across
multiple fields:
Did you mean: location = washington
vs
Did you mean: person = washington
The current parameter / response structure for the spellcheck
component does not support this kind of thing. Any thoughts on how/if
the component should handle this? Perhaps it could be in a
requestHandler where the params are passed in as json?
spelling={ dictionary="location",
onlyMorePopular=true}&spelling={ dictionary="person",
onlyMorePopular=false }
Thoughts?
ryan
Re: spellchecking multiple fields?
Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
One way would be to create a copyField containing both the fields and use it
as the dictionary's source.
If you do want to keep separate dictionaries for both the fields then I
guess we can introduce per-dictionary overridable parameters like the
per-field overridden facet parameters. That would be cleaner than json
params. What do you think?
On Wed, Jul 16, 2008 at 6:26 AM, Ryan McKinley <ry...@gmail.com> wrote:
> I have a use case where I want to spellcheck the input query across
> multiple fields:
> Did you mean: location = washington
> vs
> Did you mean: person = washington
>
> The current parameter / response structure for the spellcheck component
> does not support this kind of thing. Any thoughts on how/if the component
> should handle this? Perhaps it could be in a requestHandler where the
> params are passed in as json?
>
> spelling={ dictionary="location", onlyMorePopular=true}&spelling={
> dictionary="person", onlyMorePopular=false }
>
> Thoughts?
> ryan
>
--
Regards,
Shalin Shekhar Mangar.
Re: spellchecking multiple fields?
Posted by Ryan McKinley <ry...@gmail.com>.
and the caveat that all fields would need to be declared in the
solrconfig.xml (or get used for both fields)
this could work... would also need to augment the response with the
name of the dictionary, or assert that something will be written all
the time (so you could know the 2nd <lst name=spelling> would be for
the 2nd configured dictionary.
On Jul 16, 2008, at 8:06 AM, Grant Ingersoll wrote:
> Another thought that might work:
>
> Declare two separate components, one for each field and then
> implement a QueryConverter that takes in the field and only extracts
> the tokens for the field or choice.
>
> This is a definite workaround, but I think it might work. Hmm,
> except we only have one QueryConverter....
>
> -Grant
>
> On Jul 15, 2008, at 8:56 PM, Ryan McKinley wrote:
>
>> I have a use case where I want to spellcheck the input query across
>> multiple fields:
>> Did you mean: location = washington
>> vs
>> Did you mean: person = washington
>>
>> The current parameter / response structure for the spellcheck
>> component does not support this kind of thing. Any thoughts on how/
>> if the component should handle this? Perhaps it could be in a
>> requestHandler where the params are passed in as json?
>>
>> spelling={ dictionary="location",
>> onlyMorePopular=true}&spelling={ dictionary="person",
>> onlyMorePopular=false }
>>
>> Thoughts?
>> ryan
>
>
Re: spellchecking multiple fields?
Posted by Grant Ingersoll <gs...@apache.org>.
Another thought that might work:
Declare two separate components, one for each field and then implement
a QueryConverter that takes in the field and only extracts the tokens
for the field or choice.
This is a definite workaround, but I think it might work. Hmm, except
we only have one QueryConverter....
-Grant
On Jul 15, 2008, at 8:56 PM, Ryan McKinley wrote:
> I have a use case where I want to spellcheck the input query across
> multiple fields:
> Did you mean: location = washington
> vs
> Did you mean: person = washington
>
> The current parameter / response structure for the spellcheck
> component does not support this kind of thing. Any thoughts on how/
> if the component should handle this? Perhaps it could be in a
> requestHandler where the params are passed in as json?
>
> spelling={ dictionary="location",
> onlyMorePopular=true}&spelling={ dictionary="person",
> onlyMorePopular=false }
>
> Thoughts?
> ryan