nest

How to use X509 certificate with the Nest Elastic Client

好久不见. 提交于 2020-01-17 07:40:28
问题 I am currently upgrading from Elastic Search 1.7 to 5.2. I know there is no upgrade path, which is fine. One problem we had originally is with Nest and ElastiSearch.Net there was no way to attach an X509 certificate as it only had the ability to use Basic Authentication. To get around that we made copies of the existing github repos and modified the code directly to allow it. This ultimately is what kept us from upgrading for so long since we couldn't just use the nuget packages, because we

Can't get any documents with NEST from elasticsearch

主宰稳场 提交于 2020-01-17 07:28:13
问题 I use Searchblox to index and search my files, which itself calls ES 2.x to do the job. Searchblox uses a "mapping.json" file to initialize a mapping upon the creation of an index. Here's the link to that file. As "@Russ Cam" suggested here, I created my own class content with the following code (just like he did with the "questions" index and "Question" class): public class Content { public string type { get; set; } public Fields fields { get; set; } } public class Fields { public Content1

Nestjs

时光总嘲笑我的痴心妄想 提交于 2020-01-16 14:45:59
Nestjs for TypeScript https://docs.nestjs.com/ CLI # 全局安装CLI npm i -g @nestjs/cli # 创建项目 nest new project-name # 运行(watch模式) npm run start:dev # 创建子项目 nest g app xxx # nest g app admin 会生成一个apps文件夹,下面有admin和server文件夹 # 创建公共模块 nest g lib db # 启动子项目路 nest start -w admin # 创建子模块(一个空的文件夹) nest g mo child-module nest g mo -p admin users # 创建生成XxController nest g co xx nest g co -p admin users npm i --save @nestjs/swagger swagger-ui-express npm i mongoose @types/mongoose nestjs-typegoose @typegoose/typegoose Swagger npm i --save @nestjs/swagger swagger-ui-express ... import { SwaggerModule,

ElasticSearch NEST API update value to null

穿精又带淫゛_ 提交于 2020-01-12 18:49:53
问题 I am using NEST api and I am having trouble using client.Update<T, K> method to update a value to null Is there any parameter or settings when calling update that will allow for null to be set trough nest api? I know I can do it with sense. 回答1: Rather then changing how null should be serialised for the entire request the safest and most isolated way to do this is to introduce a separate POCO for the update where the property you want to clear has the following attribute. [JsonProperty

Reindexing using NEST V5.4 - ElasticSearch

点点圈 提交于 2020-01-11 07:46:19
问题 I'm quite new to ElasticSearch. I'm trying to reindex a index in order to rename it. I'm using NEST API v5.4. I saw this example: var reindex = elasticClient.Reindex<Customer>(r => r.FromIndex("customers-v1") .ToIndex("customers-v2") .Query(q => q.MatchAll()) .Scroll("10s") .CreateIndex(i => i.AddMapping<Customer>(m => m.Properties(p => p.String(n => n.Name(name => name.Zipcode).Index(FieldIndexOption.not_analyzed)))))); Source : http://thomasardal.com/elasticsearch-migrations-with-c-and-nest

Elastic Search, Nest. functional sorting

冷暖自知 提交于 2020-01-06 20:14:15
问题 I'm building a filter page, with facets etc, which works as it should. Now the our customer has a request to, basically "Be able to decide which sorting the items comes out in". Each product is decorated with a Product Display Order, and is in a Product Line. We got these example Product Display Orders: 1. Featured Item 2. Core Item 3. Spare Part 4. Utility And these Product Lines: 1. Hammers 2. Saw 3. Wood and the sorting is like this: Sorting should firstly be based on Product Display

ElasticSearch query using NEST 2.x with scroll is not returning result

非 Y 不嫁゛ 提交于 2020-01-06 16:22:53
问题 I'm trying to retrieve all data from the elasticsearch based on a message occurrence, i figured that if i used Scroll i could loop until the document search end but the following query returns Documents = 0 but Total = 1954: var response = client.Search<Log4Net>(s => s .Query(q => q.QueryString(qs => qs .DefaultField(m => m.Message).Query("\"" + message + "\""))) .SearchType(SearchType.Scan) .Scroll("60s")); while (response.Documents.Any()) { var request = new BulkRequest(); request.Refresh =

ElasticSearch query using NEST 2.x with scroll is not returning result

倾然丶 夕夏残阳落幕 提交于 2020-01-06 16:22:07
问题 I'm trying to retrieve all data from the elasticsearch based on a message occurrence, i figured that if i used Scroll i could loop until the document search end but the following query returns Documents = 0 but Total = 1954: var response = client.Search<Log4Net>(s => s .Query(q => q.QueryString(qs => qs .DefaultField(m => m.Message).Query("\"" + message + "\""))) .SearchType(SearchType.Scan) .Scroll("60s")); while (response.Documents.Any()) { var request = new BulkRequest(); request.Refresh =

Fuzziness functionality not working for single word in my searchasyoutype datatype field query elasticsearch nest?

百般思念 提交于 2020-01-06 05:29:08
问题 I am using nest api and searchasyoutype datatype but the fuziness(Fuzziness.Auto) is not working Following is my code: var searchResponse=_con.client.Search<object>(x=>x.Index("_all").Query(q=>q.MultiMatch(m=>m.Query(searchterm) .Fuzziness(Fuzziness.Auto) .Fields(f => f.Field("name").Field("name._2gram").Field("name._3gram")) .Type(TextQueryType.BoolPrefix) ))); Following result is when searchterm is correctly spelled with searchterm= washing https://localhost:44311/api/search/suggest/

How to use NEST/elasticsearch with Azure?

南笙酒味 提交于 2020-01-06 02:15:09
问题 I got a website (Web App) running on Azure (example.azurewebsites.net) and I want to use NEST (http://nest.azurewebsites.net) in my Asp.Net MVC solution. Locally it works fine, but when publishing it to Azure, I can't get a connection to elasticsearch. Because I did not found any useful tutorial, I mixed three together. First I created a virtual network like described here in Step 1: http://www.kerrb.com/ecAzureVms101/day4-creating-point-to-site-vpn-to-azure-virtual-machines I called it