NEST issue backporting from v7.x to v5.x

Hi all,

I'm using the C# NEST client to query an ES server running v5.3.x. I successfully implemented a v7.x NEST client but started running into some unexpected exceptions and was told that I should downgrade to a v5.x NEST client.

I ran into some issues with this most of which I've already been able to resolve.

  1. I had to remove the .TypedKeys(null) in my search descriptor.
  2. I had to set DisableDirectStreaming

I have two remaining issues:

  1. POST data-*/document/_search
    {"query":{"bool":{"filter":[{"range":{"v_avg":{"gt":260.0}}},{"range":{"timestamp":{"format":"yyyy-MM-dd'T'HH:mm:ss.SSS","gte":"2019-8-5T6:45:25.618"}}}]}},"size":10000} - For some reason "document/" gets inserted on v5.x but not on v7.x and this is causing my query to return no data. how can I get rid of that automatic document/ addition? Document is the name of NEST record type that I initialize my search queries to.
  2. I used "elasticClient.RequestResponseSerializer.SerializeToString(searchDescriptor)" to get the raw json equivalent of my query for debugging purposes. This does not work on v5.x. An alternative would be appreciated, but it looks like this is included in the API call anyway so I can simply get it from there.

Update: - v6 has the "a index to use when Project is the target POCO type" field which is not present in v7.
How can I use v6 but not have that "project" field in the endpoint?

Or in other words I have v6 with a defaultindex of "data-*".
How can I get my endpoint to be "https://server/defaultindex/_search" rather than "https://server/defaultindex/document/_search"?

Thanks in advance!

I was able to solve my own problem, by adding .Type("") to each .Search query.

I also tried setting .DefaultType in the connection settings but this did not work.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.