2016-09-19 34 views
1

我需要添加一个属性来返回时间戳,我使用下面的示例来测试在“dataimport.properties”文件中打印示例日期以获取上次修改时间。而且它不工作在SOLR中创建一个属性编写器

dataconfig.xml:

<dataConfig> 
<dataSource type="JdbcDataSource"  
driver="org.apache.cassandra.cql.jdbc.CassandraDriver"  
url="jdbc:cassandra://localhost:9160/sample"  
user="cassandra" 
password="cassandra" 
autoCommit="true"/>  
<document name="content">  
<entity name="defaults" query="SELECT id from sample.contacts" 
deltaImportQuery="select id from sample.contacts where modifiedtime >'${dataimporter.defaults.last_index_time}' allow filtering" 
deltaQuery="select id from sample.contacts where modifiedtime > '${dataimporter.last_index_time}' limit 1 allow filtering " 
autoCommit="true">  
<field column="id" name="id" /> 
</entity> 
</document>  
<propertyWriter dateFormat="yyyy-MM-dd" type="SimplePropertiesWriter" directory="conf" filename="dataimport.properties" locale="en-US"/> 
</dataConfig>` 
+0

Property Writer抛出异常** java.io.FileNotFoundException **。试试这个没有目录,文件名和语言环境的'。默认目录是“conf”,文件名是“dataimport.properties”。 –

回答

1

试试这个

<propertyWriter dateFormat="yyyy-MM-dd" type="SimplePropertiesWriter" /> 

你会开始让你的last_index_time在所需的格式(YYYY-MM-DD)中的conf /dataimport.properties。