我在schema.xml中有以下内容:
<field name="x_geo_x_coordinate" type="double" indexed="true" stored="true" default="0"/>
<field name="x_geo_y_coordinate" type="double" indexed="true" stored="true" default="0"/>
<field name="x_geo" type="location" indexed="true" stored="true" default="0.0,0.0"/>我成功地从数据库中导入了lat,只要是字符串:
<field name="x_geo_x_str_coordinate_s" type="string" indexed="true" stored="true" default="0"/>
<field name="x_geo_y_str_coordinate_s" type="string" indexed="true" stored="true" default="0"/>
<field name="x_geo_str" type="string" indexed="true" stored="true" multiValued="true" default="0,0"/>如何用一个简单的解决方案将这两个刺复制/转换成两个?
更新1: Ok,从string到double的转换非常有效,非常感谢您的解决方案!我现在有两份双份文件:
<field name="x_geo_x_coordinate" type="double" indexed="true" stored="true" default="0"/>
<field name="x_geo_y_coordinate" type="double" indexed="true" stored="true" default="0"/>我想要的是:一个位置字段中的2双值:
<field name="x_geo" type="location" indexed="true" stored="true" default="0.0,0.0"/>到目前为止,我尝试过的却没有用:
<copyField source="*_coordinate" dest="x_geo"/>
<copyField source="x_geo_str" dest="x_geo"/>有简单的解决办法吗?提前感谢!
发布于 2011-11-14 13:34:40
可以在copyField文件中使用schema.xml,如下所示:
<copyField source="x_geo_x_str" dest="x_geo_x_coordinate"/>
<copyField source="x_geo_y_str" dest="x_geo_y_coordinate"/>
<copyField source="x_geo_str" dest="x_geo"/>https://stackoverflow.com/questions/8122255
复制相似问题