nest

elasticsearch nest support of filters in functionscore function

我的未来我决定 提交于 2019-12-04 10:42:41
I am currently trying to implement a "function_score" query in NEST, with functions that are only applied when a filter matches. It doesn't look like FunctionScoreFunctionsDescriptor supports adding a filter yet. Is this functionality going to be added any time soon? Here's a super basic example of what I'd like to be able to implement: Runs an ES query, with basic scores Goes through a list of functions, and adds to it the first score where the filter matches "function_score": { "query": {...}, // base ES query "functions": [ { "filter": {...}, "script_score": {"script": "25"} }, { "filter":

Scroll example in ElasticSearch NEST API

只谈情不闲聊 提交于 2019-12-04 10:39:32
问题 I am using .From() and .Size() methods to retrieve all documents from Elastic Search results. Below is sample example - ISearchResponse<dynamic> bResponse = ObjElasticClient.Search<dynamic>(s => s.From(0).Size(25000).Index("accounts").AllTypes().Query(Query)); Recently i came across scroll feature of Elastic Search. This looks better approach than From() and Size() methods specifically to fetch large data. https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll

Elasticsearch.net client can't do basic search

无人久伴 提交于 2019-12-04 08:59:18
I have a basic Elasticsearch query that looks like this POST /fruit/_search {"query":{"term":{"Name":"banana"}}} I get result back, no problems when I run in sense. So I try to do this in elasticsearch.net var requestBody = new { query = new { term = new { Name = "banana" } } }; var result = client.Search<string>("fruit", requestBody); And I get no results back. If I just have a search body with new {} then I get hits, but not filtered. What am I doing wrong? If you use the low level client (elasticsearch.net) directly it will not do any normalisation and serialise the object verbatim: var

Using NEST to percolate

懵懂的女人 提交于 2019-12-04 07:33:41
I'm indexing my query as follows: client.Index(new PercolatedQuery { Id = "std_query", Query = new QueryContainer(new MatchQuery { Field = Infer.Field<LogEntryModel>(entry => entry.Message), Query = "just a text" }) }, d => d.Index(EsIndex)); client.Refresh(EsIndex); Now, how do I use the percolator capabilities of ES to match an incoming document with this query? To say the NEST documentation is lacking in this area would be a huge understatement. I tried using client.Percolate call, but it's deprecated now and they advise to use the search api, but don't tell how to use it with percolator...

Notadd —— 基于 nest.js 的微服务开发框架

不问归期 提交于 2019-12-04 03:36:31
前言 随着 node.js 社区的不断发展,虽然有 express 、koa 、egg .... 这样的框架,或者更应该称之为工具包,无一解决 js 作为一个后端语言的问题 —— 架构。 Nest.js 的出现解决了这些问题,它使用了 Typescript ,较为完整的 AOP 思想,同时在 IO 密集型应用上有着不俗的表现,是真正意义上的后端框架,我们团队主要成员从 PHP(Laravel) 、 Java (spring) 切换到了 Nest.js 。要说它有什么好的话,是在 开发成本(低于 go、Java),维护成本(低于go,跟 java 看齐),硬件成本(略高于 go) 三者之间的一个新的权衡。 Notadd 的出现,是在用 Nest.js 解决后端问题的基础上,用最合理的成本来解决高可用、横向拓展等问题 —— 微服务。 Nest 的全栈开发 Nest 可以说跟 Angular 是绝配了,亮点在于 Nest 在很多方面吸取了 Angular 的特性,并且许多装饰器名字也一致,开发人员可以轻松在 Nest 和 Angular 之间切换,当然,你还需要了解 CSS 和 typeorm 。这大大降低了沟通成本和开发成本,使得人员配置变得更加灵活。 Notadd 也提供了相应 Angular 的前端框架 —— ng-notadd 。 微服务的一点说明 网关层: 主要处理限流

Favor exact matches over ngram matches in ElasticSearch when mapping

你说的曾经没有我的故事 提交于 2019-12-04 03:01:04
I have partial matching of words working with ngrams. How can I modify the mapping to always favor exact matches over ngram tokens? I do not want to modify the query. One search box will search multiple types, each with their own fields. For example, lets say I'm searching job titles, one person has a title of "field engineer", the other a title of "engine technician". If a user searches for "engine", I'd want ES to return the latter as more relevant. I'm using this mapping almost verbatim: https://stackoverflow.com/a/19874785/978622 -Exception: I'm using an ngram with min of 3 and max of 11

nest 搭建项目

此生再无相见时 提交于 2019-12-04 02:16:53
Standard mode(单仓库) 和 Monorepo mode(多仓库) 两者的区别 单仓库模式支持一个服务端 例如 单独的网页和服务端支持 多仓库模式支持两个服务端,例如 后台管理界面的服务端和app界面的服务端 甚至更多 两个服务端能够共同使用一个数据库模型(当然单仓库也可以支持,只是需要尽力两个独立的服务端,数据模型也需要两份,很不方便) 第一步 全局安装nest-cli npm i -g @nestjs/cli or yarn global add @nestjs/cli 全局安装 nest-cli 第二步 创建项目nest new product 这一步完成后 Standard mode模式 使用Monorepo mode模式,需要再次进行创建 nest generate app my-app 在app 目录下创建 my-app 服务端 nest generate app my-admin 在app 目录下创建 my-admin 后台管理界面服务端 第三步 启动项目单仓库模式下 nest start or nest start:dev就可以启动了多仓库模式下有所不同 nest start my-app 启动app服务端 nest start my-admin 启动my-admin服务端 第四步 创建多仓库模式下的公共数据库 nest g library my-db

Filling the gaps in D3 array nesting

♀尐吖头ヾ 提交于 2019-12-04 01:27:37
I have an array or objects consisting of a date and some values: var flatData = [ { "date": "2012-05-26", "product": "apple" }, { "date": "2012-07-03", "product": "orange" }, ... ] I am trying to use d3.nest() to get a count of these objects by year and then by month. var nestedData = d3.nest() .key(function(d) { return d.date.split('-')[0]; }) // key is the year .sortKeys(d3.ascending) .key(function(d) { var splitDate = d.date.split('-'); return splitDate[0] + '-' + splitDate[1]; // key is year-month }) .sortKeys(d3.ascending) .rollup(function(d) { return d.length; }) .entries(flatData); This

serialize query from Nest client elastic search 2.3

隐身守侯 提交于 2019-12-03 19:32:41
问题 Since upgrading my Nest client to 2.2.1 I'm unable see the query I'm submitting to my elastic search client (now version 2.3.0). I used to use this line: string searchJson = Encoding.UTF8.GetString(client.Serializer.Serialize(myQueryHere)); But this method now returns void instead of the JSON it used to. ConnectionStatus also doesn't exist so I can no longer see the json i'm sending, does anyone know of a way? CallDetails.RequestBodyInBytes is available but that returns null. 回答1: Take a look

elasticsearch bulk indexing gets slower over time with constant number of indexes and documents

限于喜欢 提交于 2019-12-03 16:32:21
I am experiencing that bulk indexing performance using the .NET NEST client and ElasticSearch degrades over time with a constant amount of indexes and number of documents. We are running ElasticSearch Version: 0.19.11, JVM: 23.5-b02 on a m1.large Amazon instance with Ubuntu Server 12.04.1 LTS 64 bit and Sun Java 7. There is nothing else running on this instance except what comes along with the Ubuntu install. Amazon M1 Large Instance : from http://aws.amazon.com/ec2/instance-types/ 7.5 GiB memory 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each) 850 GB instance storage 64-bit