Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
RavenDB Index: Instance field 'flags' is not defined for type 'System.Decimal'

RavenDB Index fails when I use decimal properties and I can't figure out why.

My Index:

public class MyIndex : AbstractIndexCreationTask<MyDocument>
{
    public class Result
    {
        public string Id { get; set; } = string.Empty;
        public decimal? PreviousPrice { get; set; }
        public decimal? CurrentPrice { get; set; }
    }

    public NavEntriesIndex()
    {
        Map = entries =>
            from entry in entries
            select new Result
            {
                Id = entry.Id,
                PreviousPrice = entry.PreviousPriceMovement.Price,
                CurrentPrice = entry.PriceMovement.Price,
            };

        StoreAllFields(FieldStorage.Yes);
    }
}

The error:

Failed to execute mapping function on 7cb4e8c7-2807-4dd2-9b42-98938acfa11f. Exception: System.TypeInitializationException: The type initializer for 'Sparrow.Utils.DecimalHelper' threw an exception.

---> System.ArgumentException: Instance field 'flags' is not defined for type 'System.Decimal'

at System.Linq.Expressions.Expression.Field(Expression expression, String fieldName)

at Sparrow.Utils.DecimalHelper.CreateIsDoubleMethod() in C:\Builds\RavenDB-Stable-4.2\42046\src\Sparrow\Utils\DecimalHelper.cs:line 25

at Sparrow.Utils.DecimalHelper..ctor() in C:\Builds\RavenDB-Stable-4.2\42046\src\Sparrow\Utils\DecimalHelper.cs:line 18

at Sparrow.Utils.DecimalHelper..cctor() in C:\Builds\RavenDB-Stable-4.2\42046\src\Sparrow\Utils\DecimalHelper.cs:line 12

--- End of inner exception stack trace ---

at Raven.Server.Json.BlittableNumber.Parse(Object value, Double& doubleResult, Int64& longResult) in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Json\BlittableNumber.cs:line 55

at Raven.Server.Documents.Indexes.Persistence.Lucene.Documents.LuceneDocumentConverterBase.GetOrCreateNumericField(IndexField field, Object value, Store storage, TermVector termVector)+MoveNext() in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Documents\Indexes\Persistence\Lucene\Documents\LuceneDocumentConverterBase.cs:line 595

at Raven.Server.Documents.Indexes.Persistence.Lucene.Documents.LuceneDocumentConverterBase.GetRegularFields[T](T instance, IndexField field, Object value, JsonOperationContext indexContext, Boolean& shouldSkip, Boolean nestedArray) in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Documents\Indexes\Persistence\Lucene\Documents\LuceneDocumentConverterBase.cs:line 408

at Raven.Server.Documents.Indexes.Persistence.Lucene.Documents.AnonymousLuceneDocumentConverter.GetFields[T](T instance, LazyStringValue key, Object document, JsonOperationContext indexContext, IWriteOperationBuffer writeBuffer) in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Documents\Indexes\Persistence\Lucene\Documents\AnonymousLuceneDocumentConverter.cs:line 57

at Raven.Server.Documents.Indexes.Persistence.Lucene.Documents.LuceneDocumentConverterBase.SetDocument(LazyStringValue key, Object document, JsonOperationContext indexContext, IWriteOperationBuffer writeBuffer, Boolean& shouldSkip) in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Documents\Indexes\Persistence\Lucene\Documents\LuceneDocumentConverterBase.cs:line 105

at Raven.Server.Documents.Indexes.Persistence.Lucene.IndexWriteOperation.IndexDocument(LazyStringValue key, Object document, IndexingStatsScope stats, JsonOperationContext indexContext) in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Documents\Indexes\Persistence\Lucene\IndexWriteOperation.cs:line 127

at Raven.Server.Documents.Indexes.MapIndexBase`2.HandleMap(LazyStringValue lowerId, LazyStringValue id, IEnumerable mapResults, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Documents\Indexes\MapIndexBase.cs:line 68

at Raven.Server.Documents.Indexes.Workers.MapDocuments.Execute(DocumentsOperationContext databaseContext, TransactionOperationContext indexContext, Lazy`1 writeOperation, IndexingStatsScope stats, CancellationToken token) in C:\Builds\RavenDB-Stable-4.2\42046\src\Raven.Server\Documents\Indexes\Workers\MapDocuments.cs:line 107

Any Idea?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda