[英]Solr data import multi-valued field into a single valued field
我有一个多值字段
<arr name="colors">
<str>Blue</str>
<str>Red</str>
<str>Orange</str>
<str>Pink</str>
<str>Violet</str>
</arr>
像这样填充:
<entity name="pub_attributes" query=" SELECT name [description] FROM dbo.Colors">
<field name="colors" column="description" />
</entity>
我需要另一个具有所有颜色的字段,但只需要一行用白色空格隔开
<str name="Colors_All">Bue Red Orange Pink Violet</str>
我该怎么做而又不用重新访问颜色表? 也许像这样
<entity name="Properites_all" query="
DECLARE @all VARCHAR(MAX)
SET @all = ''
Select @all = @all + ... from '${pub_attributes.colors}'
UNION
Another SELECT that will add more info than just the colors
">
<field name="colors_all" column="description" />
</entity>
我想,您正在寻找的是copyfield: copyfield Wiki ,您也可以在这里看看: 如何使用它希望能对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.