Hello all,

I found a way of doing this and thought of sharing this info with you. I
found a way to dynamically change the field which gives the suggestions.
It's using the solr spellchecker (Not suggester). You can basically
configure a  indexed field as default *spellcheck.dictionary* in the config
file. Later you can set what ever the field you want suggestions from in
the request (Can set more than 1) as the spellcheck.dictionary. This way
you can set even multiple fields as spellchecker dictionaries and
suggestions will be returned according to the indexed values of those
field.

Regards,
Lasitha.

Lasitha Wattaladeniya
Software Engineer

Mobile : +6593896893
Blog : techreadme.blogspot.com

On Thu, May 12, 2016 at 8:05 AM, Lasitha Wattaladeniya <watt...@gmail.com>
wrote:

> Hi Nick,
>
> Thanks for the reply. According to my requirement I can use only option
> one. I thought about that solution but I was bit lazy to implement that
> since I have many modules and solr cores. If I'm going to configure request
> handlers for each drop down value in each component it seems like a lot of
> work. Anyway this seems like the only way forward.
>
> I can't use the option two because the combo box select the filed, not a
> value specific to a single field
>
> Best regards,
> Lasitha
>
> Lasitha Wattaladeniya
> Software Engineer
>
> Mobile : +6593896893
> Blog : techreadme.blogspot.com
>
> On Wed, May 11, 2016 at 11:41 PM, Nick D <ndrake0...@gmail.com> wrote:
>
>> There are only two ways I can think of to accomplish this and neither of
>> them are dynamically setting the suggester field as is looks according to
>> the Doc (which does sometimes have lacking info so I might be wrong) you
>> cannot set something like *suggest.fl=combo_box_field* at query time. But
>> maybe they can help you get started.
>>
>> 1. Multiple suggester request handlers for each option in combo box. This
>> way you just change the request handler in the query you submit based on
>> the context.
>>
>> 2. Use copy fields to put all possible suggestions into same field name,
>> so
>> no more dynamic field settings, with another field defining whatever the
>> option would be for that document out of the combo box and use context
>> filters which can be passed at query time to limit the suggestions to
>> those
>> filtered by whats in the combo box.
>>
>> https://cwiki.apache.org/confluence/display/solr/Suggester#Suggester-ContextFiltering
>>
>> Hope this helps a bit
>>
>> Nick
>>
>> On Wed, May 11, 2016 at 7:05 AM, Lasitha Wattaladeniya <watt...@gmail.com
>> >
>> wrote:
>>
>> > Hello devs,
>> >
>> > I'm trying to implement auto complete text suggestions using solr. I
>> have a
>> > text box and next to that there's a combo box. So the auto complete
>> should
>> > suggest based on the value selected in the combo box.
>> >
>> > Basically I should be able to change the suggest field based on the
>> value
>> > selected in the combo box. I was trying to solve this problem whole day
>> but
>> > not much luck. Can anybody tell me is there a way of doing this ?
>> >
>> > Regards,
>> > Lasitha.
>> >
>> > Lasitha Wattaladeniya
>> > Software Engineer
>> >
>> > Mobile : +6593896893
>> > Blog : techreadme.blogspot.com
>> >
>>
>
>

Reply via email to