skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. copyField instructions aren’t evaluated as a graph – the value that was originally submitted for the source field, is also used to populate the field given as dest.

    Since there was no value submitted for the spellcheck_low field, the copyField 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:

    <copyField source="spellcheck_en" dest="spellcheck_low" />
    <copyField source="spellcheck_en" dest="spellchecksearch" />
    

    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).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search