我有一个多值字段Solr的数据导入多值字段到一个单一的值域
<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>
你能接受一些你以前得到的答案吗? – javanna 2012-07-24 07:50:42