Java Lucidworks保存solr格式未知字段
我正在用spark java编写脚本。 我需要使用Lucidworks-spark Solr工具()将数据(从数据帧)插入Solr集合 My schema.xml:Java Lucidworks保存solr格式未知字段,java,hadoop,apache-spark,solr,lucidworks,Java,Hadoop,Apache Spark,Solr,Lucidworks,我正在用spark java编写脚本。 我需要使用Lucidworks-spark Solr工具()将数据(从数据帧)插入Solr集合 My schema.xml: <schema name="MY_NAME" version="1.6"> <field name="_version_" type="long" indexed="true" stored="true" /> <field name="_root_" type="string" ind
<schema name="MY_NAME" version="1.6">
<field name="_version_" type="long" indexed="true" stored="true" />
<field name="_root_" type="string" indexed="true" stored="false" />
<field name="ignored_id" type="ignored" />
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="age" type="int" indexed="true" stored="true" required="false" multiValued="false" />
<field name="height" type="tlong" indexed="true" stored="true" required="false" multiValued="false" />
<field name="name " type="string" indexed="true" stored="true" required="false" multiValued="false" />
<fieldType name="string" class="solr.StrField" sortMissingLast="true" />
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0" />
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0" />
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0" />
<fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
<uniqueKey>id</uniqueKey>
</schema>
show()给出:
但当我尝试在solr集合中插入以下内容时:
df.write()
.format("solr")
.option("collection", MY_COLLECTION)
.option("zkhost", MY_ZKHOST)
.save()
我有以下错误:
Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://MY_IP/solr/MY_COLLECTION_SHARD_REPLICA: ERROR :[doc=123456789123456789] unknown field '_indexed_at_tdt'
我不明白字段“\u index\u at\u tdt”从何而来
DataFrame似乎只有4个我想插入的字段是正确的,但我仍然无法在我的Solr集合中插入,因为这个未知字段“\u index\u at\u tdt”
更多信息:
我有一个HBase索引器,它插入到同一个集合中并且正在工作
提前感谢您的帮助 如您所见,该字段似乎是由Lucidworks代码自动添加的
您只需将对应字段添加到架构中即可:
<field name="_indexed_at_tdt" type="tdate" indexed="true" stored="true" required="false" multiValued="false" />
或者,如果您更愿意为*\u tdt设置动态
Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://MY_IP/solr/MY_COLLECTION_SHARD_REPLICA: ERROR :[doc=123456789123456789] unknown field '_indexed_at_tdt'
<field name="_indexed_at_tdt" type="tdate" indexed="true" stored="true" required="false" multiValued="false" />