Let's say we are using the elevate component that Solr provides to promote some books when necessary. But as you may already know, the standard Solr response doesn't include the information about document being elevated or not. What we would like to achieve is to get that information somehow from Solr. Actually we would like it to be as simple as running a Solr query and getting the results back. This recipe will show you how to use document transformers with the elevation component.
First of all, let's assume we have the following index structure defined in the
fields
section of ourschema.xml
file:<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> <field name="name" type="text" indexed="true" stored="true"/>
We also need to have the elevation component defined along with the search component (place the following entries in your
solrconfig.xml
file):<requestHandler name="/select" class...