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
2
votes
1 answer

elasticsearch-py can't query with script_score

I'm currently trying to query ES through Python, using elasticsearch-py but with no success... I'm testing the request on the "elasticsearch-head" plugin and it works fine (results come scored) However, when I do it in Python something seems to be…
besnico
  • 253
  • 2
  • 4
  • 13
2
votes
1 answer

Django Haystack connection error using http authentication

I'm using Haystack to connect and interact with an installation of elasticsearch. Elasticsearch is installed on a different box to the main webserver. I have set up HTTP authentication on the elasticsearch box using nginx. This is to stop…
2
votes
1 answer

Elasticsearch Date Histogram Aggregation over a Nested Array

Following are a couple of sample documents in my elasticsearch index: { message: "M1", date: "date object", comments: [ { "msg" :"good" date:"date_obj1" }, { "msg" :"bad" date:"date_obj2" }, { "msg"…
2
votes
2 answers

Automate indexing data into elasticsearch

I have a model whose flow is as follows CMS --> Postgres --> Elasticsearch --> Querying from Elasticsearch --> Final Result Everyday, new fields are added in CMS and the data is subsequently pushed into Elasticsearch. However, this takes up a lot of…
2
votes
1 answer

How to further boost the score given by field_value_factor with ElasticSearch?

I have a question in using the field_value_factor with ElasticSearch. The function that I would like to implement is alpha * log(1 + beta * doc['popularity'].value) When alpha = 1.0, the script using the field_value_factor is given by…
2
votes
2 answers

Parent / Child Relationships in Elasticsearch - Returning the results I want

I'm working on setting up an Elasticsearch index and would like it to behave (return results) a certain way. I've got a parent / child relationship set up. curl -XPUT 'http://127.0.0.1:9200/parent/' -d ' { "mappings": { "parent": {}, …
Dave Holland
  • 197
  • 7
2
votes
1 answer

Stable Django-Haystack + elasticsearch setup

I'm wondering what the best combination of Django-Haystack + elasticsearch + pyelasticsearch/elasticsearch-py is. I've deployed a setup using Haystack 2.1.1-dev + elasticsearch 1.1.1 + elasticsearch-py 1.0 on an Ubuntu 12.04 machine. I tried using…
Nagra
  • 466
  • 3
  • 8
2
votes
0 answers

ElasticSearch: Aggregation and a "WHERE" Type Clause

Wonder if someone could help. I've got an ElasticSearch index defined broadly as below: { "properties": { "content": { "type": "string" }, "topics": { "properties": { "topic_type": { "type": "string" …
Roland Dunn
  • 101
  • 3
  • 8
1
vote
1 answer

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

I am calling elasticsearch data using eland. The documentation is simple and I am able to implement it, but when searching the index it search using es_index_pattern which is basically a wildcard index-string. from elasticsearch import…
everestial007
  • 6,665
  • 7
  • 32
  • 72
1
vote
2 answers

Python Urllib ContextualVersionConflict

Till Oct 20, it was fine. Oct 21, it failed with the below messages. Can any one help here command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i8sl36tr/elasticsearch-curator/setup.py'"'"';…
Akbar B
  • 43
  • 1
  • 8
1
vote
1 answer

Elasticsearch Python API results in "search() missing 1 required positional argument" on a simple query

I am desperately trying to perform a simple search operation on elasticsearch, but fail since hours. This is my code: res = es.search(index="people", doc_type="test", body={"query":{"match":{"name": "john"}}}) I saw this many times on the internet,…
1
vote
0 answers

flask-socketio / elasticsearch (in the context of)

I was wondering if anyone had actually used the official python elastic search ES client in the context of flask-socketio (with either eventlet / gevent + the monkey patches)? The official python ES client is multi-thread safe, but that is not too…
Elrondy
  • 43
  • 1
  • 3
1
vote
0 answers

Elasticsearch - Get unique records `msearch`

I'm using msearch to query ES. following is my query:- [{ 'index': u 'INDEX', 'type': u 'TYPE' }, { 'query': { 'term': { 'FIELD1': u 'ID' } }, 'from': 0, 'size': 1 }, { 'index': u 'INDEX', …
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
1
vote
2 answers

Python elasticsearch dsl search multi fields and order result

How can i search in elasticsearch dsl python module on multi fields, example on title and body field and order it by created_at field DESC. I have this example that search only on title field: q = request.GET.get('q', None) s =…
Mirza Delic
  • 4,119
  • 12
  • 55
  • 86
1
vote
2 answers

Change cluster name in elastic search

How to rename the current cluster in elasticsearch config? i want to rename the cluster without it going down if possible.
Amogh Banta
  • 11
  • 1
  • 1
  • 5