1
私はSolrNETを使用してSolrインデックスを管理しています。 "guid"という新しいuniqueKeyフィールドでスキーマを更新した後、私はSolrにドキュメントを追加できません。Solrインデックスに追加できません - ドキュメントにuniqueKeyフィールドがありませんか?
これは、Tomcatのログエラーです:
org.apache.solr.common.SolrException: Document is missing uniqueKey field guid
私はSolrのにこのようなオブジェクトを追加している:
return new T()
{
GUID = Guid.NewGuid().ToString(),
Id = reader.GetInt32(0),
Heading = reader.GetString(1),
Body = freeText,
ForumRoom = reader.GetInt32(3),
ForumTopicId = reader.GetInt32(9),
SearchObjectType = reader.GetBoolean(5) ? SearchBase.ObjectType.ForumReply.ToString() : SearchBase.ObjectType.ForumTopic.ToString(),
Date = reader.GetDateTime(6)
};
奇妙なことに、地元をテストするとき、これは完璧に動作しますが、しかしdoesnのすべての生きている仕事。私は何をしないのです
<fields>
<field name="id" type="int" indexed="true" stored="true" required="true" />
<field name="searchobjecttype" type="string" indexed="true" stored="true" required="true" />
<field name="heading" type="text" indexed="true" stored="false" required="false" />
<field name="body" type="text" indexed="true" stored="false" required="false" />
<field name="locationid" type="int" indexed="true" stored="true" required="false" />
<field name="currentlocationid" type="int" indexed="true" stored="true" required="false" />
<field name="countryid" type="int" indexed="true" stored="true" required="false" />
<field name="currentcountryid" type="int" indexed="true" stored="true" required="false" />
<field name="forumroom" type="int" indexed="true" stored="true" required="false" />
<field name="forumtopicid" type="int" indexed="true" stored="true" required="false" />
<field name="dt" type="date" indexed="true" stored="false" required="false" />
<field name="txt" type="text" indexed="true" stored="true" multiValued="true" />
<field name="guid" type="string" indexed="true" stored="true" required="false" />
</fields>
<copyField source="id" dest="txt" />
<copyField source="searchobjecttype" dest="txt" />
<copyField source="heading" dest="txt" />
<copyField source="body" dest="txt" />
<copyField source="locationid" dest="txt" />
<copyField source="currentlocationid" dest="txt" />
<copyField source="countryid" dest="txt" />
<copyField source="currentcountryid" dest="txt" />
<copyField source="forumroom" dest="txt" />
<copyField source="forumtopicid" dest="txt" />
<copyField source="dt" dest="txt" />
<uniqueKey>guid</uniqueKey>
<defaultSearchField>txt</defaultSearchField>
<solrQueryParser defaultOperator="AND" />
:
これはschema.configがどのように見えるのですか?