1
我有這樣的「一網打盡」場在我的schema.xml:下面DynamicField名
<dynamicField name="*_s" type="string" indexed="true" stored="true" />
在這個例子中可以說我有有2個字段的表:「custom_value」和「custom_key 「這些價值觀:
custom_key 」的myKey「
custom_value: 」myvalue的「
我的目標是指數,有一個叫做場的文檔 」的myKey「 和值 」myvalue的「。我怎樣才能做到這一點?
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/MY_DB"
user="MYUSER"
password="MYPASS"
batchSize="-1"/>
<document>
<entity name="article" query="SELECT id, custom_key, custom_value FROM mytable">
<field column="id" name="id"/>
<field column="custom_value" name=":::WHAT TO PUT HERE?:::_s"/>
</entity>
</document>
不是一個hacky的解決方案。這是正確的。 –