Questions tagged [elasticsearch-net]

Repository for both Elasticsearch.Net and NEST, the two official elasticsearch .NET clients.

  • low-level client that provides a one-to-one mapping with the Elasticsearch REST API.
  • No dependencies
  • Almost completely generated from the official REST API spec which makes it easy to keep up to date
  • Comes with an integration test suite that can be generated from the YAML test definitions that the Elasticsearch core team uses to test their REST API
  • Has no opinions on how you create or consume requests and responses
  • Load balancing and cluster failover support *All calls have async variants

Home page for both Elasticsearch.Net and NEST, the two official elasticsearch .NET clients, can be found here.

Source code repository is here.

261 questions
2
votes
1 answer

Serilog Elasicsearch Sink - custom index template mapping is ignored

I am using the Serilog elasticsearch sink (version 8.4.1, elastic 7.8.0) within ASP.NET Core 3.1 with the following configuration: { "Serilog": { "MinimumLevel": { "Default": "Information", "Override": { …
Moritz Rinow
  • 213
  • 3
  • 13
2
votes
1 answer

How to Map dynamically the properties of a JObject in C# using Elasticsearch Nest

I want to map dynamically the properties inside a JObject in C# using Nest. The goal is to map every string field of the object as SearchAsYouType. I thought about 3 ways of doing that that didn't work: Use AutoMap and declare the attribute in the…
2
votes
2 answers

Is it possible to use ElasticSearch.Net or Nest for dynamic response

Is there a client.Read(...) without generics? I have found none, neither in Nest nor ElasticSearch.Net. Version 1.5 has an IDocument that might solve my problem but I cannot use that version with Elasticsearch5.5. All examples, version 5 and 6, of…
LosManos
  • 7,195
  • 6
  • 56
  • 107
2
votes
0 answers

Default JsonNetSerializer does not camel case property names

I'm injecting a custom serializer using NEST.JsonNetSerializer like this var settings = new ConnectionSettings(connPool, sourceSerializer: JsonNetSerializer.Default); When I was using the built in serializer it camel cased the property names for me…
frods
  • 311
  • 1
  • 3
  • 10
2
votes
1 answer

"Clone" index mappings

I have an index which I will be reindexing. At the moment I want to create a new index, which should contain the exact same mappings that can be found in the original index. I've got this: var srcMappings = client.GetMapping(new…
hyankov
  • 4,049
  • 1
  • 29
  • 46
2
votes
1 answer

Elasticsearch NEST DefaultMappingFor usage

Currently, I have been adding mapping through REST Api and programatically indexing documents using NEST. However, I recently came across NEST's DefaultMappingFor (in ConnectionSettings) and wondering how it's used. (Won't be able to spike soon…
Sumatan
  • 106
  • 1
  • 7
2
votes
0 answers

Create Elasticsearch query for product catalog with .Net NEST client

Using the Elasticsearch NEST library for .NET I am trying to create a query that will search for products. The model's structure is the following: [ElasticsearchType(Name = "product", IdProperty = "ProductId")] public class ProductIndex { …
2
votes
1 answer

Elasticsearch - count occurrences of (unpredictable) strings in array

Say I have a database which contains the elements such as: { "elmName" : "elm1", "arrayOfStrings" : [ "str1", "str4", "str2"] }, { "elmName" : "elm2", "arrayOfStrings" : ["str4", "str3"] }, { "elmName" : "elm3", …
Avishay
  • 305
  • 1
  • 11
2
votes
1 answer

Additional information: Method not found: 'Elasticsearch.Net.IApiCallDetails Elasticsearch.Net.IBodyWithApiCallDetails.get_CallDetails()'

After I upgraded the reference Elasticsearch.Net from 1.0.0 to 5.3.0, I keeping getting this error: Additional information: Method not found: 'Elasticsearch.Net.IApiCallDetails Elasticsearch.Net.IBodyWithApiCallDetails.get_CallDetails()'. I'm not…
Gerald Hughes
  • 5,771
  • 20
  • 73
  • 131
2
votes
1 answer

ElasticSearch Nest - querying with just indexname

Am learning to use ElasticSearch with Nest as the .Net client. While indexing the data, I don't have a defined model (type mapping) to write the index to, I rely on ElasticSearch to create that for me Creating the client var settings = new…
sppc42
  • 2,994
  • 2
  • 31
  • 49
2
votes
0 answers

Elasticsearch - C# NEST - Change Dictionary mapping behavior

I want to change the mapping behavior in C# NEST. My class looks like: public class Vector { public Guid Guid { get; set; } = Guid.Empty; public Dictionary Entries { get; set; } } The default auto mapping (e.g.) var client = new…
notesjor
  • 19
  • 1
2
votes
3 answers

Elastic Search mapping of logstash @timestamp to strongly typed in .NET

I use Serilog and the ElasticSearch Sink with AutoRegisterTemplate = true That stores the following in ElasticSearch { "@timestamp": "2016-08-17T08:57:37.3487446+02:00", "level": "Information", "messageTemplate": "User login…
MlyMly
  • 23
  • 3
2
votes
1 answer

Sharing index mapping configuration in NEST 2.3.3?

Upgrading Elastic & NEST search from 1.6.2 to 2.3.3. We used be able to share the same PutMappingDescriptor between ElasticClient.CreateIndex() and ElasticClient.Map(). But in 2.3.3, the CreateIndex needs TypeMappingDescriptor and Map requires…
Antony Francis
  • 304
  • 1
  • 7
2
votes
0 answers

ElasticClient settings not applied when running in separate tests

We are running multiple unit tests, each of them creates it's own instance of ElasticClient. Some of the tests use "StringEnumConverter" to convert enums, other will use the default convertor (into integers). The problem is that it seems the…
hoonzis
  • 1,717
  • 1
  • 17
  • 32
2
votes
2 answers

'CreateIndexDescriptor' does not contain a definition for 'AddMapping'

I am a beginner in Elasticsearch. While doing a sample application as like https://msdn.microsoft.com/en-us/magazine/dn904674.aspx , it shows an error in public void CreateMarketingIndex() { this.client.CreateIndex("marketing", c…
Ajoe
  • 1,397
  • 4
  • 19
  • 48