Python's official low-level client for Elasticsearch
Questions tagged [elasticsearch-py]
194 questions
2
votes
0 answers
elasticsearch-py driver is not filtering data properly when aggregating
I faced a weird with elasticsearch python drivers and would like if someone can explain it to me! The below code works directly from cURL but doesn't work with python-requests or elasticsearch-py, strangely, it works when I switch to pyelasticsearch…

mjalajel
- 2,171
- 21
- 27
1
vote
1 answer
Elasticsearch autocomplete query
I have set of designations stored in Elasticsearch DB, like
Senior Software Engineer
Assistant Software Engineer
Staff Software Engineer
Group Software Engineer
Software Engineer
Problem Statement:
If query is made for "Software Engg", order of…

Manish
- 11
- 3
1
vote
1 answer
Remote ElasticSearch cluster azure cloud connection using Python Client using http
I'am having a trouble to connect the Python API to Elasticsearch.
The Elasticsearch cluster is in azure cloud environment.
This is what I tried:
from elasticsearch import Elasticsearch
es = Elasticsearch(
…

saad
- 11
- 3
1
vote
2 answers
Sequential Searching Across Multiple Indexes In Elasticsearch
Suppose I have Elasticsearch indexes in the following order:
index-2022-04
index-2022-05
index-2022-06
...
index-2022-04 represents the data stored in the month of April 2022, index-2022-05 represents the data stored in the month of May 2022, and…

gusgus
- 13
- 4
1
vote
1 answer
Connection error with Elastic Search Python Client
I was trying to learn and use the elasticsearch Python client on Windows and got stuck with a connection error.
I ran the bin\elasticsearch.bat file that comes with the .zip from the official page: https://www.elastic.co/downloads/elasticsearch
I…

Rui Melo
- 47
- 9
1
vote
0 answers
Multiple database support for django-elasticsearch-dsl
We have a system where we are using a multi-database setup. E.g Multiple companies will have their own database.
Django database setup example:
{
"default":{
"ENGINE":"django.db.backends.postgresql",
"NAME":"default"
},
…

Md. Razibul Hasan Mithu
- 205
- 1
- 2
- 16
1
vote
2 answers
how can I get the searched string from list in my es.search result?
The situation is I load the df into es, the df has two columns:'url' & 'text'.
And I query the 'text' with values in a list which named 'forbidden_words'.
I wanna make the res can also present two columns, one is "url", one is "forbidden_words"…

zoe
- 11
- 2
1
vote
1 answer
Elasticsearch Parent-Child Mapping and Indexing
I was following the book "Elasticsearch: The Definitive Guide". This book is outdated and when something was not working I was searching it on the internet and making it work with newer versions. But I can't find anything useful for Parent-Child…

Sharmiko
- 543
- 4
- 21
1
vote
1 answer
How to upsert documents in an existing elasticsearch index?
I have an elasticsearch index which has multiple documents, now I want to update the index with some new documents which might also contain duplicates of the existing documents. What's the best way to do this? I'm using elasticsearch py for all CRUD…

David
- 535
- 8
- 13
1
vote
1 answer
aggregation (many value in one field) elasticsearch
I have many values in one field, when I do an aggregations, I receive these values as separate values.
Exemple :
name : jess , Region : new york
name : jess , Region : poland
request :
query = {
"size": total,
"aggs": {
…

Enya Ece Arzu
- 13
- 5
1
vote
1 answer
Convert Kibana query (create index pattern) to Python request
I'm trying to convert this Kibana query to Python:
PUT /.kibana/_doc/index-pattern:tempindex
{
"type": "index-pattern",
"index-pattern": {
"title": "tempindex",
"timeFieldName": "sendTime"
}
}
This is what I have so far:
HEADERS = {
…

Xadra
- 21
- 9
1
vote
1 answer
Index special JSON file in elasticsearch-py?
I am following this answer Index JSON files in elasticsearch using Python? however my JSON file is still recognized as one single document only.
ElasticSearch creates single fields for every entry as '0.created_at' as seen in Kibana.
My JSON file…

Raphael B.
- 72
- 4
1
vote
1 answer
Trying to load json docs in elasticsearch
I am trying to follow this answer, but I am getting error in the actions parameter of bulk method.
I am able to use next to generate array of json objects but when I pass it to helpers.bulk I get error.
This is my code:
from elasticsearch import…

Murtaza Haji
- 1,093
- 1
- 13
- 32
1
vote
1 answer
extending an list field in elasticsearch document
I have user_data field in my elasticsearch index document for eg;
sample doc:
user_data : [
{
userid :1,
order_id :32
},
{
userid :8,
order_id…

DARK_C0D3R
- 2,075
- 16
- 21
1
vote
2 answers
ElasticSearch not sorting results
I'm trying to sort the results based on a numeric field,
Here is my mapping:
{
"elasticie": {
"mappings": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type":…

DarkSuniuM
- 2,523
- 2
- 26
- 43