Elasticsearch.NET is a low-level, dependency free client that that provides a one-to-one mapping with the Elasticsearch REST API. Use this tag for questions regarding the .NET client, not for questions about Elasticsearch in general.
Questions tagged [elasticsearch.net]
54 questions
13
votes
1 answer
Elasticsearch.NET version 7 - How to Create Index
In Elasticsearch.NET 6.x, it is possible create an index using IElasticClient method:
var response = elasticClient.Create(
"my-index-name",
index => index .Mappings(
ms =>…

Nenad
- 24,809
- 11
- 75
- 93
5
votes
0 answers
How do I get the "true" root cause of an error in Elasticsearch.NET / NEST?
I'm doing some custom error handling/logging with Elasticsearch in a .NET environment using Elasticsearch.NET. Given an IResponse object, I'm trying to arrive at the best strategy for plucking out a short, succinct, and useful "root cause" message.…

Todd Menier
- 37,557
- 17
- 150
- 173
3
votes
1 answer
Elasticsearch.NET version 7 - How to Check If Index Exists
In Elasticsearch.NET 6.x, it is possible to check if index exists using IElasticClient method:
bool exists = elasticClient.IndexExists("my-index-name").Exists;
Method is removed in Elasticsearch.NET version 7.

Nenad
- 24,809
- 11
- 75
- 93
2
votes
2 answers
Elastic Search Terms query not giving result but match query is giving
I am using a Kibana query
GET /MY_INDEX_HERE/_search
{
"query": {
"match": {
"AccountId":
"bc73afda-d4f2"
}
}
}
and it is giving me the results, I expect. But when I use a terms query, it is not showing any result,…

Code Noob
- 51
- 6
2
votes
0 answers
How can I fix unintentionally repeated values in an ElasticSearch Index?
I've recently inherited ownership of some search code used by our application, and am working on cleaning up some changes by the last developer. We were hitting issues trying to query for sorted lists of documents when I started digging through the…

mnoblin
- 21
- 1
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…

vlayk
- 35
- 5
2
votes
1 answer
MultiMatch ElasticSearch Query with Filter having Must, Must_Not and Should Conditions
I am working on a POC to include Search with ElasticSearch(v7.3) in C# using ElasticSearch.Net and Nest clients. I am trying to build a Json query into Nest Query DSL to get some Data.
Here is the Json Query:
{
"query": {
"bool": {
…

Avinash Prasad
- 158
- 1
- 13
2
votes
1 answer
Correct syntax for adding a filter aggregation in a Kibana visualization as a JSON input (filtering for a specific property value)
I am trying to perform the simplest filter for a specific property value, as a JSON input, in a Kibana visualization, thoroughly without success.
I can't, to my surprise, find concrete examples in doing that (have been searching for a couple of…

Veverke
- 9,208
- 4
- 51
- 95
2
votes
1 answer
Elasticsearch.Net.ElasticSearch.Path is deprecated, what should I use instead?
In ElasticSearch.Net v.5 there is a property Elasticsearch.Net.RequestData.Path which has been deprecated in ElasticSearch.Net v.6. What should I use instead?

LosManos
- 7,195
- 6
- 56
- 107
2
votes
1 answer
Serialize query from Nest client ElasticSearch 6.4
Till ElasticSearch 6.0 we were able to serialize the search request (object of SearchRequest) to a string
using (System.IO.MemoryStream mStream = new System.IO.MemoryStream())
{
…

Raghav
- 8,772
- 6
- 82
- 106
1
vote
1 answer
Convert JSON to valid ElasticSearch.NET search response object for mocking
I am writing some tests for a system that reads from ES using ElasticSearch.NET. The program transforms a search result into a different format.
What I would like to do in the test is use a large JSON file as a mock response from ES, in order to…

Ynhockey
- 3,845
- 5
- 33
- 51
1
vote
2 answers
Elasticsearch could not search on string field
I am trying to use NEST to create search query dynamically based on user's input.
I want to add multiple filter in Filter with Term but string field searching is not possible and I cannot find any solution.
Code for example is that, this code try to…

Waayd
- 365
- 3
- 14
1
vote
0 answers
C# - ElasticSearch LowLevel Search API for Raw Json Query
I am using ElasticSearch v6.4 with Nest(v.6.4.2) and ElasticSearch.Net(v.6.4.2) Libraries. I am trying to use the Search API with my Raw Json Query.
Here is my template of JSON Query:
var jsonQuery = @"{
"_source": {
"exclude":…

Avinash Prasad
- 158
- 1
- 13
1
vote
0 answers
Creating ElasticSearch Query Dynamically using Object Intialization Method
I am trying to create a Query Module using Object Initialization method, which will build ES query dynamically based on the search criteria, using ElasticSearch.Net and Nest for .Net (version x6.4).
So what I am doing now is creating the building…

Avinash Prasad
- 158
- 1
- 13
1
vote
1 answer
How do I set the number of results return from completion/suggest?
Currently, I have the Elasticsearch service running on version 7.4.0 while my C# Windows Form application is using Elasticsearch.Net version 7.3.1.
I notice I could set the maximum number of results returned from highlight by setting…

Keith Loo
- 35
- 4