elasticsearch

How to recover streaming data even if the connection lost with Python client Elasticsearch?

How to recover streaming data even if the connection lost with Python client Elasticsearch? Question: I stream RESTful API data from https://www.n2yo.com/api/ which for tracking satellite positions. I use python client with Elasticsearch. I save the streamed data to ES every 10 seconds and visualized by Kibana. My ES vesrion is 6.4.3 My code is: …

Total answers: 1

"Failed to establish a new connection" when trying to access Elasticsearch Cloud with elasticsearch-dsl Python package

"Failed to establish a new connection" when trying to access Elasticsearch Cloud with elasticsearch-dsl Python package Question: I’m experimenting with Elasticsearch and indexing some Django data using the elasticsearch-dsl Python package. I have created a relatively basic test, search.py, but receive a connection error when I try to index any data. from elasticsearch_dsl.connections import connections …

Total answers: 2

How to detect if decimal columns should be converted into integer or double?

How to detect if decimal columns should be converted into integer or double? Question: I use Apache spark as an ETL tool to fetch tables from Oracle into Elasticsearch. I face an issue with numeric columns that spark recognize them as decimal whereas Elasticsearch doesn’t accept decimal type; so i convert each decimal columns into …

Total answers: 2

Set verify_certs=False yet elasticsearch.Elasticsearch throws SSL error for certificate verify failed

Set verify_certs=False yet elasticsearch.Elasticsearch throws SSL error for certificate verify failed Question: self.host=”KibanaProxy” self.Port=”443″ self.user=”test” self.password=”test” I need to suppress certificate validation. It works with curl when using option -k on command line. But while connecting using elasticsearch.Elasticsearch from Elasticsearch python module, it throws error. _es2 = Elasticsearch([self.host], port=self.port, scheme=”https”, http_auth=(self.user, self.password), use_ssl=True, verify_certs=False) _es2.info() …

Total answers: 2

Python pip package RequestsDependencyWarning when installing elastic-search-curator

Python pip package RequestsDependencyWarning when installing elastic-search-curator Question: I installed elastic search curator via the following command. sudo pip install -U elasticsearch-curator It all installed OK. However now when I do the following curator_cli –version I get the following dependency warning. /usr/local/lib/python2.7/dist-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown. warnings.warn(warning, RequestsDependencyWarning) …

Total answers: 2

Test elasticsearch connection in Python

Test elasticsearch connection in Python Question: I am running this code in Python: es = Elasticsearch([{‘host’: ‘localhost’, ‘port’: 9200}]).ping() print (es) if es: r = requests.get(‘http://localhost:9200′) es.indices.delete(index=’test_twitter’, ignore=[400, 404]) connected = True print(‘Connected to ES..’) else: print(‘Not connected to ES…’) When Elasticsearch is running, there is no problem with ping. The problem is when ES …

Total answers: 4

How To Push a Spark Dataframe to Elastic Search (Pyspark)

How To Push a Spark Dataframe to Elastic Search (Pyspark) Question: Beginner ES Question here What is the workflow or steps for pushing a Spark Dataframe to Elastic Search? From research, I believe I need to use the spark.newAPIHadoopFile() method. However, digging through the Elastic Search Documentation, and other Stack Q/A’s I am still a …

Total answers: 2

post request with n-delimited JSON in python

post request with n-delimited JSON in python Question: I’m trying to use the bulk API from Elasticsearch and I see that this can be done using the following request which is special because what is given as a “data” is not a proper JSON, but a JSON that uses n as delimiters. curl -XPOST ‘localhost:9200/_bulk?pretty’ …

Total answers: 4

Using shingles and fuzziness in Elasticsearch Python DSL?

Using shingles and fuzziness in Elasticsearch Python DSL? Question: How do you call shingles in Python DSL? This is a simple example that searches for a phrase in the “name” field and another one in the “surname” field. import json from elasticsearch import Elasticsearch from elasticsearch_dsl import Search, Q def make_dsl_query(fields): “”” Construct a query …

Total answers: 2