I have the follows configuration:
...
<field name="spellcheck" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_de" type="text_spell_de" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_en" type="text_spell_en" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_fr" type="text_spell_fr" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_ja" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_zh" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_pt" type="text_spell_pt" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_it" type="text_spell_it" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_low" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellchecksearch" type="text_spell_en" indexed="true" stored="false" multiValued="true" />
<copyField source="spellcheck_en" dest="spellcheck_low" />
<copyField source="spellcheck_low" dest="spellchecksearch" />
...
The spellcheck_en field is already populated and it comes correctly copied into spellcheck_low field and it is correctly indexing (using luke index viewer I see the index of the field not empty). However, the copy of spellcheck_low does not seem to work because spellchecksearch is empty. Note: spellcheck_en and spellcheck_low fields are both indexed and stored, while spellchecksearch is not stored but only indexed.
Why is this happening? You could clarify how a field copy works, thanks very much 🙂
2
Answers
spellchecksearch is empty because it’s not stored. When a field is indexed but not stored then its only available for searching but it’s value remains empty. And it doesn’t get returned in the value.
For details you can read-
Solr index vs stored
I think if you make the field spellchecksearch indexed and stored your problem will be resolved.
copyField
instructions aren’t evaluated as a graph – the value that was originally submitted for thesource
field, is also used to populate the field given asdest
.Since there was no value submitted for the
spellcheck_low
field, thecopyField
instruction ends up copying an empty value (.. or not being executed at all).In your case, you’ll have to have two destinations for the
spellcheck_en
field:This will be the same as you tried to implement, since any copy operation will take place before any processing or indexing happens (with the exception of update processors, IIRC).