Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda