Skip to content

UpdateDescriptor.Fields() with params Expression does not set fields in update request #1497

Closed
@jcachat

Description

@jcachat

This method of UpdateDescriptor:

public UpdateDescriptor<TDocument, TPartialDocument> Fields(params Expression<Func<TPartialDocument, object>>[] typedPathLookups);

is not setting the "fields" parameter correctly in the request url sent to ES.

If I issue an update statement something like this:

esClient.Update<CachedSearchItem>(u => u
  [other irrelevant stuff]
  .Fields(o => o.RatingCount, o => o.RatingValueSum)
);

I see a request URL like this (note the "Convert(" stuff):

http://localhost:9200/42ef0ba9-1f51-4572-a47a-1d94b28cec9f-cachedsearchitem/cachedsearchitem/dd841c30-3e67-4bc6-9ab7-94bdeea5fc7a/_update?fields=o %3D> Convert(o.RatingCount)%2Co %3D> Convert(o.RatingValueSum)&pretty=true

while using the string version of Fields(), I get a (valid/working) request url of:

http://localhost:9200/42ef0ba9-1f51-4572-a47a-1d94b28cec9f-cachedsearchitem/cachedsearchitem/dd841c30-3e67-4bc6-9ab7-94bdeea5fc7a/_update?fields=ratingCount%2CratingValueSum&pretty=true

This is against the latest 1.7.0 release which included the fix for issue #1296.

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