我是solr的新手,在创建索引时,我将字符串附加到数据库表id
我在schema.xml中的字段如下
<field name="id" type="string" indexed="true" stored="true" required="true"/>
<uniqueKey>id</uniqueKey>我传递'GROUP1‘作为id,但它存储的是[B@1e090ee ],如下所示。
如何存储相同的值(GROUP1)而不是[B@1e090ee?
请帮帮忙
发布于 2011-03-10 12:29:07
@mbonaci
我正在使用mysql数据库。
当我执行相同的查询时,结果还不错
以下是我的数据配置文件
<?xml version="1.0" encoding="UTF-8" ?>
<dataConfig>
<dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://host/dbname" batchSize="-1" user="username" password="password" readOnly="true" autoCommit="true" />
  <document name="products">
        <entity name="item" query="select group_id,group_title,description,DATE_FORMAT(created_date, '%Y-%m-%dT%H:%i:%sZ') as createdDate,group_status,CONCAT('GROUP',group_id) as id,'GROUP' as itemtype  from collaboration_groups where group_status=1 ">
            <field column="id" name="id" />
            <field column="group_id" name="itemid" />
            <field column="itemtype" name="itemtype" />
            <field column="group_title" name="fullName" />
            <field column="description" name="description"/>
            <field column="createdDate" name="createdDate"/>
        </entity>
 </document>
</dataConfig>https://stackoverflow.com/questions/5195136
复制相似问题