Questions tagged [nest]

1

votes
1

answer
447

Views

Elasticsearch date range check for nested array of date ranges

all devs, this is my first question here please ignore my mistakes. I am working on a project where I have a list of booking. This list has start and end dates, and for elasticsearch I already have declared and indexed them as nested 'Bookings':[{ 'StartDate':'2017-01-10T10:00:00+11:00', 'EndDate':...
Ravian
1

votes
0

answer
153

Views

ElasticSearch: source filtering by values not fields

My documents contains a nested array of Ids. I want to filter on these IDs (eg return only those documents where one of the IDs is 6489354). There might be thousands of IDs, so I only want to return the source document for those IDs that are equal to certain values (eg 1, 6, or 9) So lets say I had...
Yair Halberstadt
1

votes
0

answer
48

Views

Automatically converting a raw ElasticSearch query to NEST DSL query?

I've seen a lot of questions around here regarding how to convert a specific raw ElasticSearch query to an equivalent NEST query. My team and I often find ourselves converting a Kibana-generated request string to a NEST query so we can use it in our application. My question is, is there any automat...
nmur
1

votes
1

answer
96

Views

Terms aggregation nested in another terms aggregation

How would you implement the following request in NEST? I'm struggling with putting the 'terms' aggregation in another 'terms'. http://localhost:9200/my_index/responses/_search { 'size':0, 'aggs':{ 'FILTER':{ 'filter':{'term':{'field':{'value':'INPUT_VARIABLE_OF_THE_METHOD'}}}, 'aggs':{ 'TERMS_ROWS':...
Nili
1

votes
0

answer
117

Views

Multiple field Sorting after bucket aggregation in Nest elastic search C#

I am trying to write sorting on multiple fields after performing bucketing aggregation. When I upgraded to Nest 6.0.0.0 C# I am getting an error saying that the following I need to convert my descriptor to IPromise. I am not exactly sure how to provide this input. My function snippet is something li...
developer_ak
1

votes
1

answer
50

Views

NEST query not returning data for a Metricbeat field, held in Elasticsearch

I am trying to query metricbeat data held in elasticsearch and I'm looking for two fields: host and system.cpu.total.pct. Both are contained in my class: public string Host { get; set; } [Number(NumberType.ScaledFloat, Name = 'system.cpu.total.pct')] public float Cpu_pct { get; set; } And this is my...
Max
1

votes
0

answer
85

Views

Track reindex task

So I kick off reindexing on the ElasticSearch server: // Start reindexing on the server var response = client.ReindexOnServer(new ReindexOnServerRequest() { Source = new ReindexSource() { Index = metadataModel.SourceIndexName }, Destination = new ReindexDestination() { Index = metadataModel.Destina...
Hristo Yankov
1

votes
1

answer
31

Views

How to search a text field “as is” using NEST?

When I index a new document like this: ElasticClient.Index(product, idx => idx.Index(indexName)); and I try to search/query on this field (which is a 500 char text), I get no results. I want to search for something like: '687920/1' which is in this 500 char text.
JedatKinports
1

votes
0

answer
46

Views

Elasticsearch NEST - adding a SHOULD term dynamically

I'm building up a series of filters dynamically using the operator overloading syntax. MainQuery &= QueryContainer1; MainQuery &= QueryContainer2; etc. Some of the filters are optional so I want them to only boost the results if found. I essentially want this: bool |___must | |___term | |___term...
DarrenY
1

votes
0

answer
137

Views

Elasticsearch NEST Get Task Failures

I am working with Elasticsearch 5 and Nest 5. I running an update by query Async that will update a great number of documents. I am using 'WaitForCompletion(false)' in order to do this. The problem that I am facing is that when I use NEST to get the task that was created by the UpdateByQuery operati...
Adriano
1

votes
1

answer
322

Views

C# Nest & Elasticsearch 6.x : How to filter/count nested fields (in inner List<object>)

Here is my mapping [ElasticsearchType(Name = 'Topic')] public class Topic { [Number(NumberType.Integer, Coerce = true)] public EnumStatus Status { get; set; } [Nested] public List KeywordValues { get; set; } } [ElasticsearchType(Name = 'KeywordValue')] public class KeywordValue { [Keyword] public st...
David
1

votes
1

answer
287

Views

Elasticsearch.NET & NEST - search always returning 0 results

I'm trying to search using the ElasticClient.Search method but no matter what terms I set, or field I search by, I always get 0 results. Here is the structure of my POCO: public class MyParent { public MyChild MyChild { get; set; } } public class MyChild { public string MyField { get; set; } } And t...
Omar Himada
1

votes
0

answer
80

Views

Elasticsearch Nest full text search with filters

I have created a search descriptor in order to be able to filter some data from elasticsearch, it seems that all my tests that excercise the filters functionality pass but they fail for the full text search. I have tried all variations and am lost as to why this is happening. the poco: [Elasticsearc...
Xerxes
1

votes
0

answer
98

Views

Combining Join type with Nested type and querying in Elasticsearch 6.x

All, I am playing around with ElasticSearch 6.x with NEST and for simplicity, I created mappings with the following POCO settings based on the NEST 6.x documentation provided here https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/parent-child-relationships.html. My data model is...
Rennish Joseph
1

votes
2

answer
108

Views

ElasticSearch nested query filtered with multiple terms using Nest DSL syntax not working as expected

I'm trying to build a nested query that needs to filter by multiple terms on the nested object. I'm using Nest nuget package version 6.1 The query is build using Nest DSL syntax as follows: queryContainer &= Query.Nested(n => n .Path(p => p.Publications) .Query(q => q.Term(t => t .Field(ff => ff.Pub...
Marc
1

votes
0

answer
58

Views

Elasticsearch response is invalid for bots

I have an ASP .NET Core website that uses Nest to make requests to an elasticsearch server. I am checking if the response IsValid so I can be alerted if there is ever a problem connecting to the elasticsearch server. It works perfectly, except when bots are crawling my website. The only exceptions I...
Primico
1

votes
1

answer
65

Views

NEST mapping of Dictionary<string,dynamic> getting empty arrays

When trying to deserialize a field containing a Json from my database to index in elasticsearch all the nested fields are getting empty array as a value. { '_index': 'dev', '_type': 'user', '_id': '072512c2-fc23-471a-9e07-65c3a041f06b', '_score': 1, '_source': { 'providerInfos': '''{'Global':{'Email...
1

votes
0

answer
108

Views

ElasticSearch / NEST 6 - Serialization of enums as strings in terms query

I've been trying to update to ES6 and NEST 6 and running into issues with NEST serializing of search requests - specifically serializing Terms queries where the underlying C# type is an enum. I've got a Status enum mapped in my index as a Keyword, and correctly being stored in its string representat...
1

votes
0

answer
71

Views

Has Child join field issue

Good day: I've setup a Parent/Child relationship model between Facility and FacilityType. Currently I'm trying to query the Facility and at the same time trying to load the children by using the HasChild query but, I'm getting the following error: { 'aggs':{ 'Capacity':{ 'children':{ 'type':...
Dean
1

votes
0

answer
35

Views

Mapping to multiple data types in ElasticSearch using C# Nest

Before I dedicate the time to do this, I'm checking if anyone knows of a feature that will allow me to do something a bit more dynamic with Elastic using C#/NEST We have a situation where we will be receiving data in a field called 'Value'. That value is a string but it could represent a number, boo...
Bomlin
1

votes
1

answer
270

Views

Implement CQRS using EventStore with ElasticSearch

I am currently learning CQRS implementation using ElasticSearch and EventStore. So, I decided to use EventStore for saving the serious of event streams into EventStore and I want to use Elastic Search to Query the Data/CurrentState Data from the EventStore. My Questions are, 1.) Using ElasticSearch,...
Vignesh
1

votes
0

answer
47

Views

Add a field to an already indexed document

I have an Index in which I add and upsert documents and I would like to enrich existing document with a field which is not present in the initial mapping. Let's say I have a Parent document named 'BidResponse' which I index, then I update this document to add new fields using a Child of this parent....
Ben
1

votes
0

answer
34

Views

How to read scriptfield Distance with v6.2?

I am using ElasticSearch version 5.5.1 and NEST 6.2. I am calculating the distance using a ScriptField and including it in my search results. This solution used to work fine with an older version of NEST. I am not sure what I am doing wrong and any kind of help would be appreciated. List results = n...
cara_
1

votes
1

answer
193

Views

Method not found error in ASP.NET Core app with Json.NET/NEST/Elasticsearch

I have two projects in one solution, Project 1 and Project 2. Project 1. Target Framework is .NET Core 2.1. It's an MVC project with controllers and views. It has a reference to Project 2. Nuget packages include: Microsoft.AspNetCore.App Microsoft.NETCore.App Project 2. Target Framework is .NET Fra...
Derek
1

votes
1

answer
25

Views

Elasticsearch NEST Buckets Inside Buckets Aggregation

How can I retrieve the values from a bucket inside another bucket using NEST Link to example This is how I would normally get bucket values var colors = response.Aggregations.Terms('colors'); but how can i get the value of make var makes = response.Aggregations.Terms('colors.make');
R4nc1d
1

votes
0

answer
29

Views

Mapping method results in Elasticsearch Nest

I have a child class on my model, PersonName. public class PersonName { public string Prefix { get; set; } public string FirstName { get; set; } public string MiddleNames { get; set; } public string LastName { get; set; } public string Suffix { get; set; } public string GetFullName() => StringExten...
Magpie
1

votes
0

answer
37

Views

ElasticSearch: Mapping MultiLineString to Nest Object in .Net

I'm trying to obtain certain objects in .Net from our ElasticSearch database. In general, the attribute mapping works well, but I can't obtain my geometries, being them MultiLineStrings. Here's the part of the mapping from ES: (...) 'geometry' : { 'type' : 'geo_shape', 'tree' : 'quadtree' } (...) He...
xecollons
1

votes
0

answer
25

Views

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 (from snake case) automatically. How can I make the...
frods
1

votes
0

answer
198

Views

Unable to perform search in Elasticsearch, error “Failed sniffing cluster state.”

I have been facing a strange problem with Elasticsearch where only Search API fails with message 'Failed sniffing cluster state.'. Other APIs like Bulk and CreateIndex etc work fine. The code works in other systems also, so I am pretty sure its a problem with my local system only. Here are the detai...
Aashish
1

votes
0

answer
97

Views

How to use the snowball analyzer with NEST and ElasticSearch?

I am unclear: does the snowball analyzer have to be used when making the index? var Client = new ElasticClient(Settings); Client.CreateIndex('pictures', i => i .Settings(st => st .Analysis(a => a .Analyzers(ad => ad .Snowball('snowball', s => s.Language(SnowballLanguage.English)) ) ) ) ); or when do...
Thomas
1

votes
0

answer
64

Views

Elasticsearch with NEST to search for CommonTerms - missing documents

I am using C# with NEST to communicate with Elasticsearch. I am trying to search for documents with a 'content' field based on user-submitted text containing words, such as 'unique test'. The matched results can contain a 1 or a few of these words and the order does not matter (but the closer these...
Mayron
1

votes
1

answer
56

Views

C# NEST ElastichSearch property store but not index

I want the B field stored in Elasticsearch but never indexing. When I search for 'Nash' I do not want to search within the B field. So the B field is not indexed in elastic. [ElasticsearchType(Name = 'ES6')] public class ES6 { public string A { get; set; } public string B { get; set; } } elasticClie...
Tugrul
1

votes
1

answer
59

Views

Set the RequestResponseSerializer in ElasticClient

We've seen a resurrection of this issue in a recent update of Elasticsearch (https://github.com/elastic/elasticsearch-net/issues/1937). We set the SourceSerializer when creating the Client connection but that doesn't seem to help. Debugging in, I see that RequestResponseSerializer defaults to Nest.I...
Gerry
1

votes
0

answer
31

Views

How to Translate ElasticSearch Commands to NEST and Make Them Idempotent

I am using the ElasticSearch Rollover API and need to setup an index, rollover and alias as shown below: PUT /foo-000001 { 'aliases': { 'foo-write': {} }, 'settings': { 'index': { 'number_of_shards': '1', 'number_of_replicas': '0' } } } POST /foo-write/_rollover { 'conditions': { 'max_size': '10k...
Muhammad Rehan Saeed
1

votes
0

answer
120

Views

NestJS How to add custom Logger to custom ExceptionFilter

I am using NestJS 5.4.0 I have custom LoggerService, it's working perfectly. But, how can I add this LoggerService to ExceptionFilter. // logger.service.ts import {Injectable, LoggerService} from '@nestjs/common'; @Injectable() export class Logger implements LoggerService { log(message: string) { co...
1

votes
0

answer
51

Views

query Elasticsearch on AWS

I'm trying to make a simple query to a elasticsearch on AWS. However, when I execute it my .fsx file on OSX using VSCode + Ionide, it fails with the following exception: Elasticsearch.Net.UnexpectedElasticsearchClientException: The method or operation is not implemented. ---> System.NotImplementedEx...
P_O
1

votes
0

answer
53

Views

php-curl not sending Authorization header after redirect

I'm using PHP 7.2 and cURL 7.53.1. I'm trying to use Google's NEST REST API. I try a CURL request like this: curl_setopt_array($curl, array( CURLOPT_URL => 'https://developer-api.nest.com', CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION=>true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10...
Jesse Parker
1

votes
1

answer
40

Views

ElasticSearch Aggregation on list Items

how to Aggregate by list item (hashtext ) here my code public class Tweet { public ulong id { get; set; } public string text { get; set; } [Nest.Nested] public List hashtags { get; set; } } public class hashtags { public string hashtext { get; set; } } my index data example like: 'hashtags' : [ {...
allord
1

votes
0

answer
80

Views

How to ignore certificate checking in Elasticsearch Nest client?

I am using elastic search and nest client in asp.net core application. I have gateway which is working on https protocol (https://localhost:8080). My gateway doing only redirect all requests. When I trying to send request to elastic search through gateway throwing exception as following: Invalid NES...
sjahongir
1

votes
0

answer
19

Views

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. I originally arrived at this, which works great whe...
Todd Menier

View additional questions