ElasticSearch

ElasticSearch: How to query exact nested array

烂漫一生 提交于 2020-12-31 06:43:21
问题 I am trying to query a certain type of documents in my index. Let's see the following document: { "id": 1, "title": "My first Collection", "items": [ { "code": "SB", "order": 1, "random": "something random" }, { "code": "BB", "order": 2, "random": "something random" }, { "code": "FO", "order": 3, "random": "something random" }, { "code": "RA", "order": 4, "random": "something random" }, { "code": "FO", "order": 5, "random": "something random" } ] } The items field is a nested field. I would

干货丨DolphinDB与Elasticserach在金融数据集上的性能对比测试

我只是一个虾纸丫 提交于 2020-12-30 17:00:05
Elasticsearch是一款非常流行的日志检索和分析工具,尤其在实时性、扩展性、易用性和全文检索方面有着非常优异的综合表现。知乎上有一篇文章, Golion:降维打击!使用ElasticSearch作为时序数据库 ,并且取得了非常不错的效果。很多知乎用户不禁询问,Elasticsearch是否可以用于海量金融数据的存储和分析? 为此我们对DolphinDB和Elasticsearch在不同规模的金融数据集做了综合的对比测试。测试的内容包括I/O,磁盘空间占用,内存消耗,数据库查询(过滤查询和分组统计)4大项。测试结果没有意外,在金融数据处理领域表现十分抢眼的时序数据库DolphinDB完胜Elasticsearch。 分组统计(聚合计算),DolphinDB的表现优于Elasticsearch 10 倍左右,而且随着数据集的增大优势更明显。特别的,当测试用例涉及时间类型字段时,DolphinDB的表现尤为突出。 简单的过滤查询,DolphinDB的性能是Elasticsearch的 100 倍。 在数据导入方面,Elasticsearch的耗时是DolphinDB的 25~75 倍,并且随着数据集增大,有变大的趋势。 在磁盘空间占用上,DolphinDB做到了对原始数据的压缩,而Elasticsearch为了维护文档的索引等信息(不包括临时数据)

How to remove Elasticsearch from Ubuntu?

蹲街弑〆低调 提交于 2020-12-30 07:54:15
问题 I think that I already removed elasticsearch from my computer, and still I have some doubts. When I type: $ service elasticsearch status I get: elasticsearch.service Loaded: not-found (Reason: No such file or directory) Active: failed (Result: exit-code) since Wed 2017-08-09 01:08:18 PDT; 38min ago Main PID: 73249 (code=exited, status=1/FAILURE) Aug 09 01:08:18 ubuntu elasticsearch[73249]: Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0)

How to remove Elasticsearch from Ubuntu?

丶灬走出姿态 提交于 2020-12-30 07:52:04
问题 I think that I already removed elasticsearch from my computer, and still I have some doubts. When I type: $ service elasticsearch status I get: elasticsearch.service Loaded: not-found (Reason: No such file or directory) Active: failed (Result: exit-code) since Wed 2017-08-09 01:08:18 PDT; 38min ago Main PID: 73249 (code=exited, status=1/FAILURE) Aug 09 01:08:18 ubuntu elasticsearch[73249]: Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0)

Using multiple types or indexes in Elasticsearch php API

冷暖自知 提交于 2020-12-30 06:43:43
问题 I want to query multiple types and indices using Elasticsearch PHP API . but I don't Know how. should I pass an array of types and indices to $params ? : $params['index'] = $index;//array of indices $params['type'] = $types;//array of types $params['body'] = $q;//query body //request elasticsearch for matched documents $results = $client->search($params); 回答1: You just add them as a string to $params : $params['index'] = "index1,index2";// a comma-separated list of index names, without any

Using multiple types or indexes in Elasticsearch php API

孤者浪人 提交于 2020-12-30 06:42:40
问题 I want to query multiple types and indices using Elasticsearch PHP API . but I don't Know how. should I pass an array of types and indices to $params ? : $params['index'] = $index;//array of indices $params['type'] = $types;//array of types $params['body'] = $q;//query body //request elasticsearch for matched documents $results = $client->search($params); 回答1: You just add them as a string to $params : $params['index'] = "index1,index2";// a comma-separated list of index names, without any

Using multiple types or indexes in Elasticsearch php API

佐手、 提交于 2020-12-30 06:42:31
问题 I want to query multiple types and indices using Elasticsearch PHP API . but I don't Know how. should I pass an array of types and indices to $params ? : $params['index'] = $index;//array of indices $params['type'] = $types;//array of types $params['body'] = $q;//query body //request elasticsearch for matched documents $results = $client->search($params); 回答1: You just add them as a string to $params : $params['index'] = "index1,index2";// a comma-separated list of index names, without any

Logstash XML Parse Failed

假装没事ソ 提交于 2020-12-30 04:01:12
问题 I'm running latest ELK stack 6.6 on deviantony/docker-elk image. I have the following XML file which I try to parse into ES JSON object: <?xml version="1.0" encoding="UTF-8"?> <root> <ChainId>7290027600007</ChainId> <SubChainId>001</SubChainId> <StoreId>001</StoreId> <BikoretNo>9</BikoretNo> <DllVerNo>8.0.1.3</DllVerNo> </root> My conf file is: input { file { path => "/usr/share/logstash/logs/example1.xml" type => "xml" start_position => "beginning" sincedb_path => "/dev/null" codec =>

微服务如何拆分

a 夏天 提交于 2020-12-29 11:03:24
一、微服务如何拆分 1、先明白起点和终点 2、需要考虑的因素和坚持的原则 二、起点和终点 1、起点 既有架构的形态 2、终点   好的架构不是设计出来的,而是进化而来的。   一直在演进 三、不适合上微服务的 1、系统中包含很多很多 强事务 场景的 2、业务相对稳定,迭代周期长 3、访问压力不大,可用性要求不高 四、如何拆功能 1、单一职责,松耦合,高内聚 2、关注点分离   按职责   按通用性   按粒度级别 六、服务拆分方法 服务和数据的关系   先考虑业务功能,再考虑数据 无状态服务(一个数据被多个服务共享) 七、如何拆分“数据” 1、每个微服务都有单独的数据存储 2、依据服务特点选择不同结构的数据库类型   依据服务的功能特点,选择合适的数据库。 1)有些前置服务使用node开发,主要是展示类型的数据,对事务要求不高。那这个服务可以考虑NoSql的MongoDB 2)比如服务是做搜索类型的,我们可以优先考虑elasticsearch。 3) 对事务要求高的,优先考虑支持事务的关系型数据库,如MySql 3、难点在确定边界。 4、针对边界设计API 5、依据边界权衡数据冗余 来源: oschina 链接: https://my.oschina.net/u/4256075/blog/3750220

How to export pandas data to elasticsearch?

亡梦爱人 提交于 2020-12-29 09:38:36
问题 It is possible to export a pandas dataframe data to elasticsearch using elasticsearch-py . For example, here is some code: https://www.analyticsvidhya.com/blog/2017/05/beginners-guide-to-data-exploration-using-elastic-search-and-kibana/ There are a lot of similar methods like to_excel , to_csv , to_sql . Is there a to_elastic method? If no, where should I request it? 回答1: The following script works for localhost: import numpy as np import pandas as pd df = pd.DataFrame(np.random.randint(0,100