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
5
votes
1 answer

Simple match query to C# Nest

I new to Elasticsearch I have cURL GET /index/type/_search { "query": { "match": { "TextID": "WT" } } } I want to convert it to lambda expression in C# . I managed to build some code but it is throwing runtime…
Dipesh
  • 371
  • 1
  • 4
  • 20
5
votes
0 answers

Elasticsearch.Net and Timeouts

I have a 4 node elasticsearch cluster. I have a .net console application that is designed to fill the cluster with data which comes from sql. Everything works fine as long as I keep the rate of records being added (or deleted) fairly low. If I…
user2033791
  • 810
  • 12
  • 23
5
votes
1 answer

Elasticsearch.NET NEST Object Initializer syntax for a highlight request

I've got: var result = _client.Search(new SearchRequest("blaindex", "blatype") { From = 0, Size = 100, Query = titleQuery || pdfQuery, Source = new SourceFilter …
notsoobvious
  • 175
  • 1
  • 9
5
votes
3 answers

ElasticSearch NEST Query

I'm trying to mimic a query that I wrote in Sense (chrome plugin) using NEST in C#. I can't figure out what the difference between the two queries is. The Sense query returns records while the nest query does not. The queries are as follows: var…
Nived
  • 1,804
  • 1
  • 15
  • 29
5
votes
1 answer

Elasticsearch.net client can't do basic search

I have a basic Elasticsearch query that looks like this POST /fruit/_search {"query":{"term":{"Name":"banana"}}} I get result back, no problems when I run in sense. So I try to do this in elasticsearch.net var requestBody = new { query = new { term…
Emil C
  • 1,315
  • 4
  • 15
  • 27
4
votes
1 answer

QueryContainerDescriptor vs QueryContainer vs QueryBase

Can anyone explain what is the difference between QueryContainerDescriptor, QueryContainer & QueryBase? How can I assign a query (or QueryBase) to QueryContainer? In the code below, I can assign the same TermQuery to QueryBase and QueryContainer…
Hooman Bahreini
  • 14,480
  • 11
  • 70
  • 137
4
votes
0 answers

Elastic search NEST function_score dynamic filter conditions

I am using function_score to calculate weight based on the filter conditions, I have so many filter conditions, is there any dynamic ways to add filters and weights accordingly? var functions = new…
4
votes
1 answer

Elasticsearch 5.4 Pagination with NEST for .NET

I know, I'm so stupid that I cannot see how, but I'm new with elasticsearch. I want to know how can i do a simple pagination. Like: 1 To 10 Of 123,456 entries I need to know the total hits for the query, have sense right? public long…
Manu
  • 43
  • 1
  • 3
4
votes
2 answers

ElasticSearch NEST Executing raw Query DSL

I'm trying to create the simplest proxy possible in an API to execute searches on ElasticSearch nodes. The only reason for the proxy to be there is to "hide" the credentials and abstract ES from the API endpoint. Using Nest.ElasticClient, is there a…
MicG
  • 85
  • 1
  • 5
4
votes
1 answer

How to create a new index in Elasticsearch 5 from .Net or NEST

I am trying to create a new Elastic 5 index from .net and data from a SQL database into it using the bulk API. I have created a POCO for mapping: using Nest; namespace NEST5 { [ElasticsearchType(IdProperty = "data_id")] public class Test_Data …
4
votes
1 answer

ElasticSearch 2.x GeoPoint mapping with NEST C#

Im having a problem mapping "Geo Point" in elasticsearch using NEST C# Client. Here is my class definition: [GeoPoint(Name = "coordinates", LatLon = true)] public Coordinates Coordinates { get; set; } public class Coordinates { …
nlv
  • 791
  • 7
  • 28
4
votes
0 answers

Code base mapping in NEST 2.0

My application is using dynamic data and fields are configurable by end user. It was working fine using Code Base Mapping similar that was described in NEST example on page Put Mapping example var indexDefinition = new RootObjectMapping { …
Paweł Madurski
  • 121
  • 1
  • 4
4
votes
0 answers

ElasticSearch.NET and F# Issue w/ Query

I am attempting to convert a C# codebase over to F# that uses ElasticSearch.NET client. F# seems to not properly infer the correct types. Here is the working C# code: var res = es.Search(s => s .Query(q => q .FunctionScore(fs => fs …
bbqchickenrobot
  • 3,592
  • 3
  • 45
  • 67
4
votes
1 answer

ElasticClient Dispose

I'm new to this. I'm working with ElasticClient (.Net) and I was curious if: Is it thread safe? I assume so because it uses pooling. Should I do anything to clean up the client resources when I'm done? It does not implement IDisposable. …
Stolidedog
  • 41
  • 1
  • 2
4
votes
2 answers

InMemoryConnection for unit-testing Elasticsearch projects

Is it a good practice to use the InMemoryConnection class for unit-testing our Elasticsearch projects? This class is being used in the actual source code for unit-testing. But the reason I am asking is because it derives from HttpConnection I am not…
user11081980
  • 3,059
  • 4
  • 30
  • 48
1
2
3
17 18