Python's official low-level client for Elasticsearch
Questions tagged [elasticsearch-py]
174 questions
0
votes
1 answer
How to configure elasticsearch to use SSL with basic auth
I am trying to deploy an app that uses Ramses (http://ramses.tech) on IBM Bluemix. Unfortunately, the app is crashing during the deploy process.
In the local.ini configuration file I have set the following:
# ElasticSearch
elasticsearch.hosts =…
Charlene Gilbert
- 1
- 4
0
votes
1 answer
How to retry indexing with elasticsearch-py when using bulk streaming?
I have occasional BulkIndexError when using streaming_bulk helper. Is there any way to configure client to retry on such errors? What is the best way to handle errors when using helpers?
Oleksiy
- 5,813
- 3
- 33
- 52
0
votes
2 answers
Elasticsearch "get by index" returns the document, while "match_all" returns no results
I am trying to mock elasticsearch data for hosted CI unit-testing purposes.
I have prepared some fixtures that I can successfully load with bulk(), but then, for unknown reason, I cannot match anything, even though the test_index seemingly contains…
zahory
- 651
- 1
- 6
- 9
0
votes
2 answers
Elasticsearch delete_by_query wrong usage
I am using 2 similar ES methods to load and delete documents:
result = es.search(index='users_favourite_documents',
doc_type='favourite_document',
body={"query": {"match": {'user': user}}})
And:
result =…
Albert
- 93
- 1
- 11
0
votes
1 answer
How to logging unicode dictionary from elasticsearch-py?
By default, elasticsearch-py logs output dictionary as json dumped like:
{'key': '2016\u5e747\u670829\u65e5'}
While I'd like to see the result as following:
{'key': '2016年7月29日'}
How can I do that?
EDIT
Python 2.7.10
$ pip freeze | grep…
Cockcrow
- 11
- 5
0
votes
1 answer
How to query on unanalyzed fields?
I have a few things in my elasticsearch_dsl class that i want to query for an exact match:
class Profile(DocType):
name = String(fields={'raw': String(index='not_analyzed')})
While that does work, i always need to add a .raw to the query and…
shredding
- 4,376
- 3
- 36
- 66
0
votes
1 answer
Error while deleting a index in Elastic search
I am working with Elastic search Python API. I created a index called "sample". But, facing an exception while trying to delete the same. Below is my approach.
Elastic search instance,
es = Elasticsearch("abc.def.ghi.jkl:9300")
Checking whether…
Jack Daniel
- 2,091
- 3
- 26
- 42
0
votes
1 answer
Python elasticsearch return only entries that have a certain field
I'm trying to query an Elasticsearch, and only get results that have a certain field.
How do I query for documents that have field fields.EventData.PGID and ignore ones that don't?
datadict = es.search(index=idx1,
…
Hal T
- 497
- 6
- 19
0
votes
0 answers
Advanced Query in Elasticsearch
I have started using elasticseach engine with my application, and I have encountered a problem.
I'm currently indexing as the following: each entry has its -
username
file_path
md5
My goal is to determine how many unique (count of 1 per username )…
Den1al
- 469
- 1
- 6
- 15
0
votes
0 answers
Range query not formatted properly? (Elasticsearch)
I am using the python elastic search client to query my elasticsearch index. My index is very small, because I am trying to deduce where my query is going wrong. Here is an example entry
_source: {
Expiration: 20160115
}
and another
_source: {
…
Zack
- 11,342
- 19
- 69
- 105
0
votes
1 answer
Elasticsearch match query with partial text match
Newbie question on elasticsearch. I have set up the elasticsearch lucene index and use searching for names that contain some term, such as
search_response = es.search(index = 'sample', body = {'query':{'match':{'first_name':"JUST"}}})
This does not…
DonDyck
- 1,353
- 4
- 18
- 35
0
votes
2 answers
Elasticsearch build dynamic query - python
A newbie question on elasticsearch-py api. I built an index of records of name, address, phone number etc and I can query using the python client
eg.
`elasticsearch.search(index = "index_name", q= 'first_name:"JOHN"')`
and get the appropriate…
DonDyck
- 1,353
- 4
- 18
- 35
0
votes
0 answers
doc_freq increases as I call update API in Elasticsearch-Py
I have exactly 100 documents were already indexed in Elasticsearch and I need to update each document by adding a new simple field using the following function:
def add_new_field( ):
ES_HOST = {"host" : "localhost", "port" : 9200}
ES=…
K.Ali
- 273
- 4
- 14
0
votes
1 answer
How do I filter by geo-distance in elasticsearch-py?
Using Python 2.7 and elasticsearch-py.
Given the following JSON:
[
{
"Name":
"Addresses": [
"StreetAdd": "xxx",
"GeoLocation": {
"lat": xx,
"long": yy
}
…
NullDev
- 13,073
- 4
- 44
- 50
0
votes
1 answer
How to make elastic increase a counter on every update?
I want to create a (url,visits) index on elasticsearch which will hold the number of visits a particular url every time I call function myfunction. How can I do that? So far, I have managed to create the insertion but I am unable to increase the…
user706838
- 4,494
- 10
- 47
- 73