Skip to content

PostInvertedIndexBody Serialization  #470

Closed
@kealist

Description

@kealist

Just documenting though I think this has been fixed in master, but not a release. There are serialization errors when running the following code. I assume this was something from PostInvertedIndexBody overloading Fields property.


Message: 
ArangoDBNetStandard.Serialization.SerializationException : An error occured while Deserializing the data response from Arango. See InnerException for more details.
---- Newtonsoft.Json.JsonReaderException : Unexpected character encountered while parsing value: {. Path 'fields', line 1, position 292.

  Stack Trace: 
ApiClientBase.DeserializeJsonFromStream[T](Stream stream)
IndexApiClient.PostIndexAsync(PostIndexQuery query, PostIndexBody body, CancellationToken token)
IndexApiClient.PostInvertedIndexAsync(PostIndexQuery query, PostInvertedIndexBody body, CancellationToken token)

var collection = new PostIndexQuery { CollectionName = "document" };
var postBody = new PostInvertedIndexBody
{
    Name = "inverted",
    Fields = new List<InvertedIndexField> { new InvertedIndexField { Name = "description", Analyzer = "text_en" } }
};
await db.Index.PostInvertedIndexAsync(collection, postBody);

This has just been a hassle with the index changes in 3.10 and trying to follow the index guide, which don't work with this client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions