Upsert Using NEST 7

Unfortunately, the docs for NEST is completely useless in providing answers to so many issues. Everything is available for Elasticsearch and can easily be found. But if you are looking for the same thing in NEST - Forget it!
Is there anyway to Upsert a document and exclude various fields from being updated should they exist.

Many thanks

Thank you for the feedback. The client documentation is intended to be supplementary to the Elasticsearch reference documentation, focusing more on the conventions and idioms of the client. We have started on a project to bring examples of each language client into the Elasticsearch reference documentation for all officially supported clients. This is in early stages at the moment, but you can see what this looks like on the master branch at:

Expect more in the future.

What do you feel is specifically missing from the client documentation that makes it completely useless?

It is not that it is completely useless. Its just that whenever we need to find something that is a little bit more than the basic stuff, we have to use the elastic search syntax and try to convert to NEST.

P.S. The links you have sent me seem to also be just for non NEST syntax or am I missing something.

Thanks

Each of the Kibana Console examples has a dropdown menu at the bottom of the code block that allows switching to another language:

switching language will switch all code blocks to that language, and the preference will be stored locally so that the page will default to this language in future.

The client tries to map as closely to the underlying Elasticsearch API JSON structure as possible. For example, using the fluent lambda expression syntax:

var client = new ElasticClient();

var searchResponse = client.Search<Document>(s => s
	.Query(q => q
		.Match(m => m
			.Field(f => f.Path)
			.Query("value")
		)
	)
	.Sort(so => so
		.Field("_score", SortOrder.Descending)
	)
);

maps to

{
  "query": {
    "match": {
      "path": {
        "query": "value"
      }
    }
  },
  "sort": [{
    "_score": {
      "order": "desc"
    }
  }]
}

You can always use the low level client API and send JSON too, returning a high level response when using the low level client exposed on the high level client:

var lowLevelResponse = client.LowLevel.Search<SearchResponse<Document>>("documents", @"
{
  ""query"": {
	""match"": {
	  ""path"": {
	    ""query"": ""value""
	  }
	}
  },
  ""sort"": [{
    ""_score"": {
      ""order"": ""desc""
    }
  }]
}");

Many thanks for your help.
Greatly appreciated.

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