[TYPO3-Solr] Render SOLR_MULTIVALUE in result

Albert van der Veen albert.van.der.veen at xs4all.nl
Mon Aug 27 16:53:59 CEST 2012


Hi all,

Perhaps I'm overlooking something obvious, but I can't seem to get this 
working:

I have a SOLR_MULTIVALUE field, that can contain integer values 1,2,3,4 
corresponding to publication types.

Now I want to show the types instead of the integers in the result. 
Thought I could accomplish this using the fieldRenderingInstructions, 
but this typoscript doesn't do the trick:

fieldRenderingInstructions {

	producttype_stringM = TEXT
	producttype_stringM {
		field = producttype_stringM
		split{
			token = ,
			cObjNum = 1
			1 {
				cObject = CASE
				cObject {
					current = 1
					key.data = current:1

					1= TEXT
					1.value = Paper
					
					2= TEXT
					2.value = Digital
				}
				insertData = 1
			}
		}
      	}
      			
}

Testing this I get a correct result if the field contains only one value 
(for instance 1, the publication is Paper only). But if the field 
contains more values (so 1,2 - the publication being available in Paper 
and Digital format), nothing gets rendered. Debugging seems to suggest 
that an array enters the CASE statemnet, not a single value splitted 
from the array.

Any suggestions?

Thanks,
Albert


More information about the TYPO3-project-solr mailing list