lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "DocTransformers" by GrantIngersoll
Date Fri, 18 Nov 2011 14:41:22 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "DocTransformers" page has been changed by GrantIngersoll:
http://wiki.apache.org/solr/DocTransformers?action=diff&rev1=2&rev2=3

  /!\ EXPERIMENTAL -- Since Solr 4.0
  
- Document Transformers give you a way to modify fields that are returned to the user.
+ Document Transformers give you a way to modify fields that are returned to the user.  For
instance, you can use them to include the results of a FunctionQuery or to mark items that
have been editorially boosted by the QueryElevationComponent.
  
  <<TableOfContents>>
  
+ == Configuring ==
+ You can add a DocTransformer to your application by configuring it in the solrconfig.xml,
as in:
+ {{{
+ <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory"
/>
+ }}}
+ 
+ This will add an instance of the EditorialMarkerFactory (used to mark items that have been
editorially boosted by the QueryElevationComponent so that an application has the option of
treating them specially) to the system.  
+ 
+ Just like other components, you can initialize DocTransformers:
+ {{{
+ <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory"
>
+   <double name="defaultValue">5</double>
+ </transformer>
+ }}}
+ See the example solrconfig.xml for other examples of adding transformers.
+ 
+ == Invoking ==
+ 
+ To add a transformed field to your results, pass in the name of the configured transformer
as a field name, enclosed in brackets in the &fl field list, as in
+ {{{
+ ...&fl=id,score,[qecBooster]
+ }}}
+ 
+ In this case, assuming our configuration from above, the EditorialMarkerFactory will be
invoked and a new field will be added to the document with the name qecBooster and a value
of true for any document that was editorially boosted.
+ 
+ You can also pass run time specific values by adding them as attributes inside of the brackets,
as in:
+ {{{
+ ...&fl=id,score,[myTransformer foo=1 bar=good]
+ }}}
+ 
+ <!> TODO: Example of using functions <!>
  
  == Standard Transformers ==
  
@@ -56, +87 @@

  
  Add the internal docid to the request
  
- 

Mime
View raw message