nest

C# nest elasticsearch geo point array index not shown in kibana

北城余情 提交于 2019-12-14 03:19:14
问题 I have the following classes public class MyLayer { public List<MyLocation> Locations { get; set; } } public class MyLocation { public string Name { get; set; } public MyCoordinate Coordinate { get; set; } } public class MyCoordinate { public double Lat { get; set; } public double Lon { get; set; } } And this code to index objects var node = new Uri("http://localhost:9200"); string indexName = "geopoint-tests2"; var settings = new ConnectionSettings( node, defaultIndex: "geopoint-tests2" );

nest : how use UpdateByQuery()?

廉价感情. 提交于 2019-12-14 02:36:22
问题 I would like to use the UpdateByQuery() methode If i understood well i need to give a query and a select. for example i would like to change the name property to "welcome" in my proj class I start to write my methode but i don't know what to do after that? client.UpdateByQuery<proj>(q => q.Query(rq => rq.Term(f => f.idProjet, projetEntity.IdProjet))); I don't see Update fluent methode in the intellisense helper Could you help me please? 回答1: You need to use the Script method. This example

ElasticSearch .NET Core TaskCanceledException

浪尽此生 提交于 2019-12-13 22:13:09
问题 Running a very simple program (.NET Core 1.0.0-preview2-003121, NEST 2.4.2, Windows 7) that generates documents with random data and pushes them to an ElasticSearch 2.3.4 node running on localhost with ES_HEAP_SIZE=4g . The program batches document inserts and sends them using the BulkPutAsync API. It runs fine for a while, inserting well over 500K documents. Then the program seems to stall, ElasticSearch seems to stop indexing (CPU usage goes down) and finally a TaskCanceledException is

ElasticSearch NEST Delete all document

*爱你&永不变心* 提交于 2019-12-13 21:26:50
问题 I am using ElastciSearch 2.3.0 I am trying to delete documents from the ElasticSearch using .net and NEST for specific index. I only want to delete all documents and not the _mapping DeleteByQueryRequest r = new DeleteByQueryRequest(new IndexName() { Name = indexName }); r.QueryOnQueryString = "*"; var response = client.DeleteByQuery(r); I am try to do this by using above code but it is not working. Please suggest on what's wrong with the above code or how this can be done. Thanks for your

“Clone” index mappings

女生的网名这么多〃 提交于 2019-12-13 20:27:35
问题 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 GetMappingRequest((Indices)sourceIndexName)).Mappings; And I try to create an index: var response = client.CreateIndex(destinationIndex, c => c .Settings(...my settings ...) .Mappings(... what here? ...) ); What exactly should I pass to the .Mappings(...) above so

Bulk write on ElasticSearch 2.0 NEST 2.0 throws a stackoverflow exception

痴心易碎 提交于 2019-12-13 19:04:59
问题 I was using bulk insertion on my ElasticSearch 1.0 and NEST 1.0. Now I moved to ElasticSearch 2.0 and NEST 2.0 and the bulk insertion throws a stackoverflow (!) exception. My gut feeling is that an infinite recursion is taking place and it consumes the entire stack. this is my POCO [ElasticsearchType(Name = "MyDoc")] public class MyDoc: DynamicResponse { [String(Store = false, Index = FieldIndexOption.NotAnalyzed)] public string HistoryId { get; set; } [String(Store = false, Index =

Retrieve data from elasticsearch results

淺唱寂寞╮ 提交于 2019-12-13 19:02:47
问题 I'm writing a method that will search on elastic search for a determined query string, I get the results with several data such as Highlights, Hits, score; But I want only to get and access the data that is within the Documents, how can I achieve that in C#? This is my code so far: public string GetByOpinionDocumentTextElastic(string queryString) { var settings = new ConnectionSettings(new Uri(ConfigurationManager.AppSettings["ElasticSearchAddress"])).SetDefaultIndex("caselaw"); var client =

How can I subscribe to many NEST devices from many different users using a single Node.JS server

假装没事ソ 提交于 2019-12-13 11:19:40
问题 I am trying to scope a project for a client that wants to be able to subscribe to many (perhaps 10's of thousands) of NEST devices for many different users from one or more Node.js servers. The idea being to aggregate change events from many devices owned by many clients. Could Node.js handle that many simultaneous Firebase change subscriptions? How would that best be managed? Thanks 回答1: Firebase engineer here, The problem with this current approach is that Nest currently only allows a

Nest 5.5 BulkAll Observable error

笑着哭i 提交于 2019-12-13 07:24:52
问题 This references a previous question: Nest 5.5 Error using BulkAll method. Here is the related code. The following is in a repository: var cancellationTokenSource = new CancellationTokenSource(); return _elasticClient.BulkAll(capacities.Value, ba => ba .Index(indexName) .Type(IndexType) .MaxDegreeOfParallelism(_settingsHelper.GetBulkAllDegreeOfParallelism()) // in case of 429 response (too many requests), how long we should wait before retrying .BackOffTime(TimeSpan.FromSeconds(_settingsHelper

In Nest 1.7.1 Delete or DeleteByQuery nothing works

筅森魡賤 提交于 2019-12-13 07:00:32
问题 In Nest 1.7.1 Delete or DeleteByQuery nothing works for me. I am trying to delete below documents: Article article1 = new Article() { Id = 1111, Title = "Title - Test Elastic Search", Summary = "Summary - Test Elastic Search", Body = "Body - Test Elastic Search", ArticleDate = _dateToday, Author = new Author() { Id = 100, Name = "Mikey" }, }; Article article2 = new Article() { Id = 2222, Title = "Title - Test Elastic Search", Summary = "Summary - Test Elastic Search", Body = "Body - Test