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
31
votes
2 answers

How to check if an index exists in elasticsearch using a python script and perform exception handling over it?

How do I check whether an index exists or not using a python query? I'm passing my index as a variable assigned outside the query as :- i=int(datetime.datetime.now().strftime('%d'))+1 indextring="index" for m in range (i-10,i): d =…
26
votes
4 answers

Like search in Elasticsearch

I am using elasticsearch for filtering and searching from json file and I am newbie in this technology. So I am little bit confused how to write like query in elasticsearch. select * from table_name where 'field_name' like 'a%' This is mysql query.…
13
votes
5 answers

How to sync MSSQL to Elasticsearch?

Every time I Google this, I find the "river" approach which is deprecated. I'm using Dapper if this is somehow a helpful information. So what's the solution for this these days?
tedi
  • 6,350
  • 5
  • 52
  • 67
10
votes
3 answers

How to have different log types using Serilog and ElasticSearch

I am currently trying to change our system configuration to work with Serilog (instead of working with FileBeat as a shipper to LogStash) We are also working with the log type field (which is easy to configure in the FileBeat config file) in our…
Green
  • 2,405
  • 3
  • 22
  • 46
9
votes
3 answers

Multiple should queries with must query

I am building a query to Elastic 5 (using nest in .net), i am trying to achive this result: Must have value1 and value 2 Should have value3 or value 4 and should have value5 or value6 Here is my query: { "query": { "bool": { …
IB.
  • 1,019
  • 3
  • 13
  • 21
9
votes
3 answers

"Current error context error is different to requested error" exception in Json.Net

Context I've written a parallel job framework in C# to import/export a large amount of data from/to an ElasticSearch cluster. To do this I've modelled each import or export of a single item as an object that gets executed at some point by the…
rikkit
  • 1,127
  • 3
  • 18
  • 35
8
votes
1 answer

Bulk insert to ElasticSearch with NEST

I try to add 100k products to elasticsearch, but when i try i get: {"Validation Failed: 1: no requests added;"} My code: var Node = new Uri("......"); var ConnectionPool = new SniffingConnectionPool(new[] { Node }); var…
mrcode
  • 465
  • 2
  • 5
  • 16
7
votes
2 answers

Searching Date Field value in ElasticSearch without time

I have one date field in my data as "type": "date", "format": "dateOptionalTime" Now My date Field and Value is - "INITIAL_EXTRACT_DATE" : "2015-04-02T06:47:57.78+05:30" While searching I am searching based on only date that is "2015-04-02". but…
Mukesh
  • 422
  • 2
  • 4
  • 9
6
votes
1 answer

How do I serialize properties of type JToken or JObject in Elasticsearch NEST?

I'm introducing Elasticsearch into a C# API project. I'd like to leverage existing API models as search documents, many of which allow for adding custom data points. These are implemented using the JObject type from Json.NET. For example: public…
Todd Menier
  • 37,557
  • 17
  • 150
  • 173
6
votes
2 answers

How to check if connection to Elasticsearch is established?

I want to check if the connection to Elasticsearch database is ok. In other words I want to ping Elasticsearch. When I execute the code below, an exception is thrown. public async Task Execute() { if…
Jagjit Singh
  • 661
  • 9
  • 16
6
votes
1 answer

ElasticType and ElasticProperty attributes non found on nest.dll 2.1.1

I'm learning elasticsearch+nest, i want to map a type into a net class: [ElasticType(Name="car")] public class Car {} { [ElasticProperty(Name = "color", Index = FieldIndexOption.NotAnalyzed, Type = FieldType.String)] public string Color {…
FDB
  • 971
  • 16
  • 32
6
votes
2 answers

Post raw json using elastic search client

I have upgraded to ElasticSearch.Net /Nest 2.0.2 and I can no longer use the low level client method (connector.GetClient().Raw.Bulk()). I have looked at the documentation but I can't seem to find any that shows how to post raw json using the new…
Imran Azad
  • 1,008
  • 2
  • 12
  • 30
6
votes
1 answer

Elasticsearch aggregation on array items

Given below is my Elasticsearch document on which I want to fire an aggregation query. { "id": 1, "attributes": [ { "fieldId": 1, "value": "Male" }, { "fieldId": 2, "value": "12/11/2015" } ] } { "id":…
hendrixchord
  • 4,662
  • 4
  • 25
  • 39
5
votes
1 answer

Building a dynamic query using object initializer syntax

I am using Nest, to Query Elasticsearch and I have written this query for my search: var searchResponse = _elasticClient.Search(s => s .Query(q => q .Bool(b => b .Must(m => m .MultiMatch(mm => mm …
user9610034
5
votes
0 answers

return hits from one bucket when doing a geodistance search in elasticsearch .net

I want to do a geosearch where it should first search for all locations within a distance of 50 meters, if more than 5 hits are found, then return those. If less than 5 hits are found I want to expand and search all locations within a distance of…
1
2 3
17 18