elasticsearch-plugin

Getting process not defined error when connecting angular 5 with ElasticSearch?

拜拜、爱过 提交于 2019-12-24 08:57:15
问题 It's my first time using angular with elastic and I am getting the above error on the line "this.client = new Client(//.." exact error ReferenceError: process is not defined at Log.push../node_modules/elasticsearch/src/lib/log.js.Log.addOutput (log.js:213) at new Log (log.js:51) at new Transport (transport.js:19) at new EsApiClient (client.js:58) at new Client (client.js:101) at ElasticsearchService.push../src/app/elasticsearch.service.ts.ElasticsearchService.connect (elasticsearch.service.ts

Count distinct on elastic search

早过忘川 提交于 2019-12-24 08:26:02
问题 How to achieve count distinct function on elastic search type using sql4es driver? Select distinct inv_number , count(1) from invoices; But it returns the total count of the particular invoice number. 回答1: Since, the OP is using sql4es jdbc driver , he is asking for a sql query for his use-case : SELECT COUNT(DISTINCT inv_number) from invoices; it returns the number of distinct values of the specified column 回答2: { "size": 0, "aggs": { "total_invoices": { "terms": { "field": "inv_number" },

How to delete all data from an index using delete_ by_query plugin with ES 2.X versions in rails app?

梦想与她 提交于 2019-12-24 08:25:45
问题 I have upgraded my elasticsearch to 2.0 version in my rails 4.2.7 app and am trying to delete all index data using delete-by-query plugin. How can i achieve this? i was using delete_by_query method like this Elasticsearch::Model.client .delete_by_query(index: index_klass.index_name, body: {query: {match_all: {}}}) But this is deprecated in ES 2.X versions. so how can i use plugin to do this. thanks in advance. 回答1: Instead of deleting all the data in an index, I strongly suggest deleting the

Different results for same query in Elasticsearch Cluster

我怕爱的太早我们不能终老 提交于 2019-12-24 07:50:10
问题 I have created a Elasticsearch cluster with 3 nodes , having 3 shards and 2 replicas. The same query fetch different results when hit to the same index with same data. Right now the results are basically sorted by the _score field desc (I think its the default way of sorting) and requirement also wants that the result be sorted in desc order of there score. So here my question is why does same query yield different result, and then how can this be corrected to have same result every time with

CRATE 0.28.0.1 and elasticsearch-cloud-aws plugin compatibility

こ雲淡風輕ζ 提交于 2019-12-23 20:47:44
问题 We are going to use CRATE with elasticsearch-cloud-aws plugin for ES to create backups. It looks like current version 0.28.0.1 (from deb package) has an issue with run time environment for aws plugin. It says: {1.0.1}: Initialization Failed ... - NoClassDefFoundError[org/elasticsearch/common/collect/Lists] ClassNotFoundException[org.elasticsearch.common.collect.Lists] It makes Crate incompatible with aws backup plugin. It would be great to have any aws-based backup plugin on board, because it

ElasticSearch in Spring with @Query

旧街凉风 提交于 2019-12-23 20:15:22
问题 I have successfully created a query using ElasticSearch's _plugin/head interface. The query is meant to return the latest timestamp for a specific device at a specific location. The query looks as follows: { "query":{ "bool":{ "must":[ { "term":{ "deviceevent.location.id":"1" } }, { "term":{ "deviceevent.deviceId":"AHE1LDD01" } } ] } }, "from":0, "size":1, "sort":{ "timestamp":{ "order":"desc" } } } The above query works as intended. Now using Spring-Boot and Spring-Data-ElasticSearch, I

In Elasticsearch where to generate keystore and add authentication in readonlyrest plugin?

非 Y 不嫁゛ 提交于 2019-12-23 04:06:06
问题 I am trying to add password authentication in my elasticsearch cluster using readonlyrest plugin. I installed the plugin successfully now i am trying to configure my configuration file(.yml file) but there In case 0 they are using a keystore see below http.type: ssl_netty4 readonlyrest: enable: true ssl: enable: true keystore_file: "/elasticsearch/plugins/readonlyrest/keystore.jks" keystore_pass: readonlyrest key_pass: readonlyrest Can anyone please tell me from where i can generate this

ElasticSearch - define custom letter order for sorting

守給你的承諾、 提交于 2019-12-22 13:49:07
问题 I'm using ElasticSearch 2.4.2 (via HibernateSearch 5.7.1.Final from Java). I have a problem with string sorting. The language of my application has diacritics, which have a specific alphabetic ordering. For example Ł goes directly after L , Ó goes after O , etc. So you are supposed to sort the strings like this: Dla Dła Doa Dóa Dza Eza ElasticSearch sorts by typical letters first, and moves all strange letters to at the end: Dla Doa Dza Dła Dóa Eza Can I add a custom letter ordering for

How to reindex ElasticSearch quickly?

本秂侑毒 提交于 2019-12-21 12:39:11
问题 I have an ElasticSearch index with around 200M documents, total index size of 90Gb. I changed mapping, so I would like ElasticSearch to re-index all the documents. I wrote a script that creates a new index (with the new mapping), then goes over all the documents in the old index and puts then into the new one. It seems to work, but the problem is that it works extremely slowly. It started with 300 documents / minute two days ago, and now the speed is 150 documents/minute. The script runs on a

Elasticsearch bulk index api via rest endpoint

試著忘記壹切 提交于 2019-12-17 20:06:25
问题 Here is my request: POST /_bulk { "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } } {"firstname":"first_name1","lastname":"last_name1"}, {"firstname":"first_name2","lastname":"last_name2"}, {"firstname":"first_name3","lastname":"last_name3"}} Here is the error: { "error": "IllegalArgumentException[Malformed action/metadata line [3], expected START_OBJECT or END_OBJECT but found [VALUE_STRING]]", "status": 500 } Basically, each document is {"firstname": ___, "lastname": ____} I