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
4
votes
5 answers

Elasticsearch python API: Delete documents by query

I see that the following API will do delete by query in Elasticsearch - http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html But I want to do the same with the elastic search bulk API, even though I could…
sysuser
  • 1,072
  • 1
  • 13
  • 30
3
votes
3 answers

How to select or retrieve only specific fields after elasticsearch query?

I am able to query an index in elasticsearch. And, now I want to narrow down the data to some specific fields. But, I am keep getting errors. Here is my query: es = Elasticsearch(hosts="myhost", "port":0000) search_body={ "bool":{ …
everestial007
  • 6,665
  • 7
  • 32
  • 72
3
votes
3 answers

How to update_index for haystack from a external script?

I am using Django Haystack with ElasticSearch backend for my search page. I am using MongoDB as my Database. Everything was working fine in my search page. PROBLEM My web-application uses an external script for changing a field in the backend…
3
votes
1 answer

Create custom analyzer filter for a index in py-elasticsearch-dsl

i'm working with py-elasticsearch-dsl for my master, i'm creating a index of title documents in a corpus of turkish titles, and i need implements a custom lowercase analyzer for turkish language:…
SalahAdDin
  • 2,023
  • 25
  • 51
3
votes
4 answers

How to delete documents from multiple indices using particular field name in elasticsearch python?

This is sample document. { "_index": "mqtt-index-2018.01.23", "_type": "iot_data", "_id": "AWEjA7LNRU4cTUO-Lyj4", "_score": null, "_source": { "message": "{\"datastream_name\": \"roshni\", \"value\": 12, \"context\": {\"latitude\": 0,…
3
votes
1 answer

ElasticSearch: Ranking with multiple weighted functions; when using random_score other functions are ignored

I want to have a complex ranking made out of several functions that I want to weight and multiply with the search _score. I understand this is possible with the function_score -> functions parameter. Here's what I have (note, this is Python): …
cpury
  • 1,003
  • 10
  • 18
3
votes
1 answer

Elasticsearch Search Down - SearchPhaseExecutionException

My server was running fine until I start getting this error for search queries: RequestError: TransportError(400, u'SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures…
Pratik Poddar
  • 1,353
  • 3
  • 18
  • 36
3
votes
1 answer

How to connect to a specific cluster in Elasticsearch with python API

I have 2 elasticsearch clusters (not nodes) I would like to access using the python official api. I have changed Cluster lines in config files of each elasticsearch clusters: cluster.name: elasticsearch_prod cluster.name: elasticsearch_traf But I…
Thibaut
  • 133
  • 1
  • 10
3
votes
3 answers

Elastic Search Function_Score Query with Query_String

I was doing search using elastic search using the code: es.search(index="article-index", fields="url", body={ "query": { "query_string": { "query": "keywordstr", "fields": [ "text", "title", "tags", …
Pratik Poddar
  • 1,353
  • 3
  • 18
  • 36
2
votes
1 answer

How to search exact index (not index pattern) in elasticsearch eland - updated?

I am calling elasticsearch data using eland. The documentation is simple and I am able to implement it, but when searching the index it searches the index string using es_index_pattern which is basically a wildcard (it is also stated in the…
everestial007
  • 6,665
  • 7
  • 32
  • 72
2
votes
0 answers

Elasticsearch python bulking parallel issue

I am attempting to bulk index a generator using the parallel bulk method from elasticsearch helpers in python, however it seems that this method doesn't perform anything. If I use the regular bulk method, the ingestion in to elasticsearch runs just…
Aboogie
  • 450
  • 2
  • 9
  • 27
2
votes
1 answer

elasticsearch aggregate unique entries of hashes and find all tags

I have two sets of hashes in single index with a different tag as an additional field like below: Index: hashes-* sha1-c tag abcdefg12345 collect abcdefg12345 collect bcdefgh12345 collect cdefghi …
johnnyb
  • 1,745
  • 3
  • 17
  • 47
2
votes
1 answer

Python Elasticsearch DSL query value from a list

I am using Python's Elasticsearch DSL package: http://elasticsearch-dsl.readthedocs.org/en/latest/search_dsl.html My sample elasticsearch entry looks like: { "_index" : "users", "_type" : "player", "_id" : "1", "_version" : 5, "found" :…
Ankit
  • 3,878
  • 5
  • 35
  • 51
2
votes
1 answer

Elasticsearch mapping empty string

In Elasticsearch, one of my field is a date which I define the mapping with custom date format matching my date. However, some cases the value of my date field is just an empty string "LastUpdateDate": "" and causes an exception. How can I handle…
Philip K. Adetiloye
  • 3,102
  • 4
  • 37
  • 63
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