nest

DocumentExists() fails when a wildcard is used in its Type

拈花ヽ惹草 提交于 2019-12-08 09:36:54
问题 The problem also exists for Update() using a Type wildcard, but I found that DocumentExists() does the same thing, so I've distilled the issue down here: This works... var docExists = client.DocumentExists<object>(d => d .Index(indexname) .Id(myId) .Type("Abcdef")); but this fails... var docExists = client.DocumentExists<object>(d => d .Index(indexname) .Id(myId) .Type("Abc*")); It also fails if I omit the Type altogether. Anyone know how to make this work? (Even if it worked regardless of

Partial update elastic search NEST 2.x

雨燕双飞 提交于 2019-12-08 02:51:30
问题 how can partial update a record in using NEST2? I'm looking for an analog request: POST /erection/shop/1/_update {"doc": {"new":"0"}} without recreating a new record. unfortunately I did not find anything about the updates in www.elastic.co/guide/en/elasticsearch/client/net-api/current/index.html UPDATE: var updateResponse = es.Current.Update<MyDocument, MyDocument> (DocumentPath<MyDocument>.Id(2), descriptor => descriptor .Doc(new MyDocument { name = "new name" })); I run this code, but it

How to bulk insert Json using NEST elasticsearch?

£可爱£侵袭症+ 提交于 2019-12-08 02:43:41
问题 I'am trying to insert multiple records into my database using Nest. Inserting using IndexMany class does work however I also need to insert objects by json string. I did look on github, and found some examples how to use the RAWclient. Below a code example I insert my json. > var twitter = _jsonData; > var result = client.Raw.BulkPost( > new { twitter } > , qs => qs > //.Replication(ReplicationOptions.Async) > .Refresh(true) ); some additional info: jsondata: tweet tweet1 = new tweet { id =

How to search array property by array in elasticsearch with nest client

Deadly 提交于 2019-12-07 07:11:45
问题 Lets say we have a class called acls and this class has a List property called lprop. Now lets say I have another List which has values 1,3,5 and lets say this variables name is tosearch. I want to search tosearch values in acls typed records lprop property in an index of elasticsearch by using nest and finding only one match is sufficient. Ex: `public class acls { public List<int> lprop {get;set;} } public void main() { //.. creating connection and etc.. // we have 3 recs of acls // 1. lprop

How to store a c# List of objects into ElasticSearch with NEST 2.x

删除回忆录丶 提交于 2019-12-07 01:57:20
I'm developing a cross-platform app with xamarin.forms and I'm trying to look for a way to store a List of Objects directly into ElasticSearch so I can later search for results based on the objects of the lists. My scenario is the folloring: public class Box { [String(Index = FieldIndexOption.NotAnalyzed)] public string id { get; set; } public List<Category> categories { get; set; } } public class Category { [String(Index = FieldIndexOption.NotAnalyzed)] public string id { get; set; } public string name { get; set; } } My aim is to be able to search for all the boxes that have a specific

.net Elasticsearch 学习入门笔记

混江龙づ霸主 提交于 2019-12-06 21:04:29
一. es安装相关 1.elasticsearch安装 运行http://localhost:9200/ 2.head插件 3.bigdesk插件安装 (安装细节百度:windows elasticsearch 安装,有详细内容) 二. es插件相关 http://www.searchtech.pro/elasticsearch-plugins (es 插件大全) https://github.com/medcl/elasticsearch-analysis-ik (ik 项目) https://github.com/lmenezes/elasticsearch-kopf (ES的插件 监控 节点状态 , 也可以调试你的ES查询) https://github.com/medcl/elasticsearch-rtf/tree/master (2.1.1 + 1.6ik 还有拼音 和其他分词器 集成好了) https://github.com/lmenezes/elasticsearch-kopf (类似head的插件) https://www.elastic.co/downloads/marvel (监控ES健康状态) konf插件 (据说能看集群负载) 三.es C# 客户端示例 1. 包下载elasticsearch.net,nest 组件。

Elasticsearch NEST client creating multi-field fields with completion

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 14:30:49
I am trying to create some completion suggesters on some of my fields. My document class looks like this: [ElasticType(Name = "rawfiles", IdProperty = "guid")] public class RAW { [ElasticProperty(OmitNorms = true, Index = FieldIndexOption.NotAnalyzed, Type = FieldType.String, Store = true)] public string guid { get; set; } [ElasticProperty(OmitNorms = true, Index = FieldIndexOption.Analyzed, Type = FieldType.String, Store = true, IndexAnalyzer = "def_analyzer", SearchAnalyzer = "def_analyzer_search", AddSortField = true)] public string filename { get; set; } [ElasticProperty(OmitNorms = true,

NEST Search whole document C# Elasticsearch

余生颓废 提交于 2019-12-06 11:04:54
I want to make a query over a million documents in Elasticsearch using Nest. My code: var response = client.Search<MyObject>(s => s .Index("test") .Type("one") .Query(q => q. Term( t => t.name, "A" ) ) .Size(10000) .Scroll("10m") .Pretty() ); My MyObject class: public class MyObject { public int id { get; set; } public int age { get; set; } public string lastname { get; set; } public string name { get; set; } } The problem is when this query is not found in the first 10k documents, it won't continue searching the rest of the results scroll API. My question is how to achieve this (i.e moving

Partial update elastic search NEST 2.x

我们两清 提交于 2019-12-06 08:05:40
how can partial update a record in using NEST2? I'm looking for an analog request: POST /erection/shop/1/_update {"doc": {"new":"0"}} without recreating a new record. unfortunately I did not find anything about the updates in www.elastic.co/guide/en/elasticsearch/client/net-api/current/index.html UPDATE: var updateResponse = es.Current.Update<MyDocument, MyDocument> (DocumentPath<MyDocument>.Id(2), descriptor => descriptor .Doc(new MyDocument { name = "new name" })); I run this code, but it is fully updated the whole document. result https://gyazo.com/2fdae851bb8bc445f6e8e58abb2f0e3b what am I

Searching an elasticsearch index with NEST yields no results

隐身守侯 提交于 2019-12-06 07:56:25
I'm playing around with NEST, and I'm adding stuff to the ES index without any problems. Getting any results back is another matter, however. Here's the output in my browser for /nest-testing/_search/?pretty { "took" : 0, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 1, "max_score" : 1.0, "hits" : [ { "_index" : "nest-testing", "_type" : "plain_text", "_id" : "\\\\domain.net\\path\\to\\lorem.txt", "_score" : 1.0, "_source" : { "id": "\\\\domain.net\\path\\to\\lorem.txt", "full_unc_path": "\\\\domain.net\\path\\to\\lorem.txt", "file_name"