SOLR数据导入器

时间:2015-08-04 16:23:58

标签: solr

是否可以从SOLR DataImporter中的查询中指定动态字段名称?我找到了一些关于javascript解决方法的参考资料,但它们是从2010年开始的,所以我希望它现在能够正常工作。

我正在努力实现如下。但是这些字段的索引是使用externalIdentifier所在的空白。

<entity name="price" query="select pl.currencyUnit, pl.externalIdentifier, pl.label, pp.amount * 100 as 'amount', pp.wasAmount * 100 as 'wasAmount' from product_price_lists pl 
    inner join product_prices pp
    on pl.id = pp.priceList_id
    where pp.product_id = 1
    and pp.markForDelete = 0
    and publishDate &lt; now()
    and archiveDate is null or archiveDate &gt; now();
    ">
    <field column="amount" name="${price.externalIdentifier}__price" />
    <field column="wasAmount" name="${price.externalIdentifier}__price" />
    <field column="currencyUnit" name="${price.externalIdentifier}__currency__s" />
</entity>       

1 个答案:

答案 0 :(得分:0)

添加字段名称Like。此

<dynamicField name="${price.externalIdentifier}__price" type="string" indexed="false" stored="true"/>
or 
<dynamicField name="${price.externalIdentifier}__price" type="string" indexed="true" stored="true"/>