Questions tagged [pyelasticsearch]

pyelasticsearch is a clean, future-proof, high-scale python API to elasticsearch.

pyelasticsearch is a clean, future-proof, high-scale python API to elasticsearch. It provides features like...

  • Transparent conversion of Python data types to and from JSON
  • Translating HTTP status codes representing failure into exceptions
  • Connection pooling Load balancing of requests across nodes in a cluster Failed-node marking to avoid downed nodes for a period
  • Optional automatic retrying of failed requests

https://pyelasticsearch.readthedocs.io/en/latest/

89 questions
1
vote
1 answer

make HTTP request from python and wait a long time for a response

I'm using Python to to access a REST API that sometimes takes a long time to run (more than 5 minutes). I'm using pyelasticsearch to make the request, and tried setting the timeout to 10 minutes like this: es =…
kielni
  • 4,779
  • 24
  • 21
0
votes
0 answers

Elastic Search Query on String Array Field

I'm working on Elastic Search and facing an issue regarding Array field. I've index named test-index with following mapping. { "test-index": { "mappings": { "properties": { "courses": { "type": "keyword" } …
0
votes
1 answer

How can I use kerberos under python elasticsearch?

I checked the documentation of elasticsearch:7.x but still didn't find the way how I can force the python ES package to use my kerberos token. I can reach the ES through a browser, curl ( curl --negotiate -u ) and requests with requests_kerberos (…
papi1992
  • 169
  • 3
  • 15
0
votes
1 answer

Python Elasticsearch update_by_query not working

I want to update multiple docs using update_by_query in elasticsearch.py (version 7.13.1) My query is: es_query = { "query": { "match": {"user_id.keyword": user_id} # "bool": { # "must": [{"term": {"user_id":…
Ankita Gupta
  • 155
  • 2
  • 14
0
votes
1 answer

Python elasticsearch - GET finds the document but search does not

I am trying basic commands in elasticsearch and I am stuck with basic search. My script: from elasticsearch import Elasticsearch INDEX_NAME = 'person' es = Elasticsearch([{'host': 'localhost', 'port': 9200}]) data = { 'name':…
dom
  • 414
  • 3
  • 12
0
votes
1 answer

Elasticsearch problem with pre-defined mapping and then index docs

I am trynig to index stackoverflow data. First of all I create an index with specified mapping and setting. @classmethod def create_index_with_set_map(cls, name, elasticsearch): """ create index with default mappings and…
0
votes
1 answer

Can't set types of fields when creating indexes

I am using Elasticsearch 7.6.2 (by running the official docker image with the default options) and py-elasticsearch 7.6.0 (installed with version >=7.6 <8) I am trying to create an index with a float field like this (as…
Bob
  • 5,809
  • 5
  • 36
  • 53
0
votes
0 answers

Painless script throwing connection error in py-elasticsearch

I have the following script search query: bdy = { "query": { "function_score": { "script_score": { "script": { "lang": "painless", "inline": "def test = "+test1+"; float total = 0; for (int i = 0; i <…
0
votes
0 answers

How to push data to elasticsearch from dataframe in python

I am trying to use elastic search libraries like pyelasticsearch and elasticsearch I am not getting any method where i can pass dataframe and that method will load data frame data to elastic search. I am trying a this code: for i,df in…
PriyalChaudhari
  • 363
  • 1
  • 7
  • 23
0
votes
1 answer

py-elasticsearch stop printing errors

I am using a py-elasticsearch to query elasticsearch: try: res = es.get(index='unique_names', doc_type='name', id=token, ignore=['404']) except elasticsearch.exceptions.NotFoundError: continue As you can see I use an exception for if the index…
Jens de Bruijn
  • 939
  • 9
  • 25
0
votes
1 answer

Error while loading bulk data into Elasticsearch

I am using Elasticsearch in python. I have data in pandas frame(3 columns), then I added two columns _index and _type and converted the data into json with each record using pandas inbuilt method. data = data.to_json(orient='records') This is my…
Jack Daniel
  • 2,527
  • 3
  • 31
  • 52
0
votes
1 answer

ElasticSearch: Access outer document fields from within an nested aggregated query

I have the following mapping: { "dynamic": "strict", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "things": { "type": "nested", …
Roland Dunn
  • 101
  • 3
  • 8
0
votes
0 answers

haystack.exceptions.MissingDependency: The 'elasticsearch' backend requires the installation of 'elasticsearch'

I am newbie to Django-haystack. I got an error while following Django-Haystack documentation. Command execution order, I followed: I started elasticsearch server (1.7.3) using command prompt and I am able to access http://127.0.0.1:9200/ python…
0
votes
1 answer

streaming and bulk update to elasticsearch

As part of data analysis, I collect records I need to store in Elasticsearch. As of now I gather the records in an intermediate list, which I then write via a bulk update. While this works, it has its limits when the number of records is so large…
WoJ
  • 27,165
  • 48
  • 180
  • 345
0
votes
1 answer

Querying nested objects in Elasticsearch

I have a Product-Merchant mapping which looks like the following catalog_map = { "catalog": { "properties": { "merchant_id": { "type": "string", }, …
battery
  • 31
  • 5