I assume here you've got a spellcheck field like this:

<field name="Spelling_Dictionary" type="text_general"/>
<copyField source="field1" dest="Spelling_Dictionary" />
<copyField source="field2" dest="Spelling_Dictionary" />
<copyField source="field3" dest="Spelling_Dictionary" />
<copyField source="field4" dest="Spelling_Dictionary" />

...so that a check against "Spelling_Dictionary" always checks all 4, right?  
This is the only way I know to approximate having it spellcheck across multiple 
fields.  And as you have found, short of creating several separate versions of 
"Spelling_Dictionary", there is no way to specify the individual fields a la 
carte.  Although not supported, some of the work was done as part of SOLR-2993.

Your best bet now is to use "Spelling_Dictionary" as a master dictionary then 
use "maxCollationTries" to have it generate collations that only pertain the 
what the user actually searched against.  This is less efficient and may not 
work well (or at all) with Suggest.

James Dyer
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: Wilson Passos [mailto:wrpas...@gmail.com] 
Sent: Tuesday, May 28, 2013 11:54 PM
To: Solr User List
Subject: Choosing specific fields for suggestions in SpellCheckerComponent

Hi everyone,


I've been searching about how to configure the SpellCheckerComponent in 
Solr 4.0 to support suggestion queries based on s subset of the 
configured fields in schema.xml. Let's say the spell checking is 
configured to use these 4 fields:

<field name="field1" type="text_general"/>
<field name="field2" type="text_general"/>
<field name="field3" type="text_general"/>
<field name="field4" type="text_general"/>

I'd like to know if there's any possibility to dynamically set the 
SpellCheckerComponent to suggest terms using just fields "field2" and 
"field3" instead of the default behavior, which always includes 
suggestions across the 4 defined fields.

Thanks in advance for any help!


Reply via email to