I'm experimenting with porting our 3.5 database to the new RC2 but I'm running into a bit of a problem with an index that used to work just fine. The index is trivially simple as is the data, so I'm quite puzzled. I've tried to boil it down to the essentials. The index (its the same with or without any field indexing specified:
{
"Content": "",
"ContentEncoding": "utf8",
"ContentType": null,
"@metadata": {
"@collection": "SessionContents",
"Raven-Clr-Type": "UVAudit.Core.SessionContent, UVAudit.Core"
}
}
Failed to execute mapping function on SessionContents/4d7b037a-d707-46fc-9b79-2167bee5a48b. Exception: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'Sparrow.Json.Parsing.DynamicJsonValue'.
at Raven.Server.Documents.Indexes.Persistence.Lucene.Documents.LuceneDocumentConverterBase.GetRegularFields[T](T instance, IndexField field, Object value, JsonOperationContext indexContext, Boolean nestedArray) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Indexes\Persistence\Lucene\Documents\LuceneDocumentConverterBase.cs:line 346
at Raven.Server.Documents.Indexes.Persistence.Lucene.Documents.AnonymousLuceneDocumentConverter.GetFields[T](T instance, LazyStringValue key, Object document, JsonOperationContext indexContext) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Indexes\Persistence\Lucene\Documents\AnonymousLuceneDocumentConverter.cs:line 59
at Raven.Server.Documents.Indexes.Persistence.Lucene.Documents.LuceneDocumentConverterBase.SetDocument(LazyStringValue key, Object document, JsonOperationContext indexContext, Boolean& shouldSkip) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Indexes\Persistence\Lucene\Documents\LuceneDocumentConverterBase.cs:line 107
at Raven.Server.Documents.Indexes.Persistence.Lucene.IndexWriteOperation.IndexDocument(LazyStringValue key, Object document, IndexingStatsScope stats, JsonOperationContext indexContext) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Indexes\Persistence\Lucene\IndexWriteOperation.cs:line 104
at Raven.Server.Documents.Indexes.MapIndexBase`2.HandleMap(LazyStringValue lowerId, IEnumerable mapResults, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Indexes\MapIndexBase.cs:line 67
at Raven.Server.Documents.Indexes.Workers.MapDocuments.Execute(DocumentsOperationContext databaseContext, TransactionOperationContext indexContext, Lazy`1 writeOperation, IndexingStatsScope stats, CancellationToken token) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Indexes\Workers\MapDocuments.cs:line 110
The above error occurs for every document indexed and I have no clue what is supposed to be of this DynamicJsonValue type. I have tried deleting and recreating the index without luck. No other indexes are affected like this. I've inserted data from an export from the old data but without indexes which where instead created from running the new code. Hope someone can help me out.
I'm running the server RavenDB-4.0.0-rc-40023-windows-x64 on a 64 bit Windows 10 installation. The client is version 4.0.0-rc-40023.