lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kenf_nc <ken.fos...@realestate.com>
Subject Re: DIH and multivariable fields problems
Date Tue, 10 Aug 2010 18:02:14 GMT

I do multivalue dynamic fields, but only if I use a script transform. Put
this after your <dataSource...>
  <script><![CDATA[ 
      function pivotDynamicData(row) { 
        var name = row.get('CORE_DESC_TERM');
	row.put(name+ '_s');
	row.remove('CORE_DESC_TERM');

        return row; 
      } 
    ]]></script>

then make your entity query look like this (add the transformer line):

<entity name="terms" query="select distinct CORE_DESC_TERM from metadata
where item_id=${item.DIVID_PK}"> 
  <entity name="metadata" 
          query="select * from metadata where item_id=${item.DIVID_PK} AND
core_desc_term='${terms.CORE_DESC_TERM}'" 
          transformer="script:pivotData" /> 
  </entity> 
</entity>

Anyway, something similar to this works for me. I haven't tested these
actual values, but something close should work.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/DIH-and-multivariable-fields-problems-tp1032893p1076608.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message